Skip to content

Instantly share code, notes, and snippets.

@ibrahimsha23
Created October 17, 2020 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibrahimsha23/6b538bbc133339c2cec2f0953bc92652 to your computer and use it in GitHub Desktop.
Save ibrahimsha23/6b538bbc133339c2cec2f0953bc92652 to your computer and use it in GitHub Desktop.
# load libraries

import requests
from bs4 import BeautifulSoup
import pandas as pd
# defining after academy url
base_url = "https://afteracademy.com"
tech_url = "/tech-interview/ds-algo-problem-set/top-problems"
url = base_url + tech_url
req = requests.get(url)
soup = BeautifulSoup(req.content, 'html.parser')
data = soup.find_all("table", class_="MuiTable-root")
data_frame = pd.read_html(str(data))[0]
data_frame.head()
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
# Title Solution Topic Difficulty Companies
0 1.0 Roman To Integer NaN Mathematical Algorithms Medium AmazonMicrosoftFacebook
1 2.0 Reverse Bits NaN Mathematical Algorithms Easy Amazon
2 3.0 Square Root of Integer NaN Mathematical Algorithms Medium AmazonMicrosoftFacebook
3 4.0 Calculate power function NaN Mathematical Algorithms Easy GoogleLinkedInAmazon
4 5.0 Greatest Common Divisor NaN Mathematical Algorithms Medium Google
tabledata = data[0]
thead = tabledata.thead
headers = []
for i in thead.find_all('th'):
    headers.append(i.text)
headers.append("Problems")   
headers
['#', 'Title', 'Solution', 'Topic', 'Difficulty', 'Companies', 'Problems']
tbody = tabledata.tbody
body_content = []
for i in tbody.find_all('tr'):
    all_row = i.find_all('th')
    temp_data = [""] * 7
    temp_data[0] = all_row[0].div.h6.text
    temp_data[6] = base_url + all_row[1].h6.a.get('href')
    temp_data[1] = all_row[1].h6.a.text
    temp_data[2] = base_url + all_row[2].h6.a.get('href') if all_row[2].h6 and all_row[2].h6.a else None
    temp_data[3] = all_row[3].h6.text
    temp_data[4] = all_row[4].h6.div.span.text
    temp_data[5] = ','.join(k.span.text for k in all_row[5].h6.find_all('div'))
    body_content.append(temp_data)
body_content
[['1.',
  'Roman To Integer',
  'https://afteracademy.com/blog/convert-roman-numerals-to-integers',
  'Mathematical Algorithms',
  'Medium',
  'Amazon,Microsoft,Facebook',
  'https://afteracademy.com/problems/roman-to-integer'],
 ['2.',
  'Reverse Bits',
  'https://afteracademy.com/blog/reverse-bits',
  'Mathematical Algorithms',
  'Easy',
  'Amazon',
  'https://afteracademy.com/problems/reverse-bits'],
 ['3.',
  'Square Root of Integer',
  'https://afteracademy.com/blog/find-the-square-root-of-a-given-integer',
  'Mathematical Algorithms',
  'Medium',
  'Amazon,Microsoft,Facebook',
  'https://afteracademy.com/problems/square-root-of-integer'],
 ['4.',
  'Calculate power function',
  'https://afteracademy.com/blog/calculate-power-function',
  'Mathematical Algorithms',
  'Easy',
  'Google,LinkedIn,Amazon',
  'https://afteracademy.com/problems/calculate-power-function'],
 ['5.',
  'Greatest Common Divisor',
  'https://afteracademy.com/blog/greatest-common-divisor',
  'Mathematical Algorithms',
  'Medium',
  'Google',
  'https://afteracademy.com/problems/greatest-common-divisor'],
 ['6.',
  'Find the Closest Palindrome',
  'https://afteracademy.com/blog/find-the-closest-palindrome',
  'Mathematical Algorithms',
  'Hard',
  'Microsoft,Amazon',
  'https://afteracademy.com/problems/find-the-closest-palindrome'],
 ['7.',
  'Rotate matrix',
  'https://afteracademy.com/blog/rotate-matrix',
  'Iteration / Two Pointer Approach',
  'Medium',
  'Google',
  'https://afteracademy.com/problems/rotate-matrix'],
 ['8.',
  'Spiral Matrix',
  'https://afteracademy.com/blog/spiral-order-traversal-of-a-matrix',
  'Iteration / Two Pointer Approach',
  'Medium',
  'Microsoft,Amazon',
  'https://afteracademy.com/problems/spiral-matrix'],
 ['9.',
  'Wave Array',
  'https://afteracademy.com/blog/wave-array',
  'Iteration / Two Pointer Approach',
  'Easy',
  'Amazon,Google,Adobe',
  'https://afteracademy.com/problems/wave-array'],
 ['10.',
  'Set Matrix Zeroes',
  'https://afteracademy.com/blog/set-matrix-zeros',
  'Iteration / Two Pointer Approach',
  'Medium',
  'Amazon,Google',
  'https://afteracademy.com/problems/set-matrix-zeroes'],
 ['11.',
  'maximum j – i such that A[j] > A[i]',
  None,
  'Iteration / Two Pointer Approach',
  'Medium',
  'Google,Amazon,Adobe',
  'https://afteracademy.com/problems/maximum-j-minus-i-such-that-arr-j-is-greater-than-arr-i'],
 ['12.',
  'Move zeroes to an end',
  'https://afteracademy.com/blog/move-all-the-zeroes-to-the-end',
  'Iteration / Two Pointer Approach',
  'Easy',
  'Facebook,Uber',
  'https://afteracademy.com/problems/move-zeroes-to-an-end'],
 ['13.',
  'Merge two sorted arrays',
  'https://afteracademy.com/blog/merge-two-sorted-arrays',
  'Iteration / Two Pointer Approach',
  'Medium',
  'Microsoft,Adobe',
  'https://afteracademy.com/problems/merge-two-sorted-arrays'],
 ['14.',
  'Container with Most Water',
  'https://afteracademy.com/blog/container-with-most-water',
  'Iteration / Two Pointer Approach',
  'Medium',
  'Amazon,Google,Facebook,Adobe',
  'https://afteracademy.com/problems/container-with-most-water'],
 ['15.',
  'Remove duplicates from sorted array',
  'https://afteracademy.com/blog/remove-duplicates-in-a-sorted-array',
  'Iteration / Two Pointer Approach',
  'Medium',
  'Amazon,Microsoft,Google',
  'https://afteracademy.com/problems/remove-duplicates-from-sorted-array'],
 ['16.',
  'Find an element in Bitonic array',
  'https://afteracademy.com/blog/find-an-element-in-a-bitonic-array',
  'Recursion / Divide & Conquer',
  'Easy',
  'Amazon',
  'https://afteracademy.com/problems/find-an-element-in-bitonic-array'],
 ['17.',
  'Find minimum element in sorted and rotated array',
  'https://afteracademy.com/blog/minimum-in-a-sorted-and-rotated-array',
  'Recursion / Divide & Conquer',
  'Medium',
  'Facebook',
  'https://afteracademy.com/problems/find-minimum-element-in-sorted-and-rotated-array'],
 ['18.',
  'Median of two sorted array of same size',
  'https://afteracademy.com/blog/median-of-the-two-sorted-array-of-same-size',
  'Recursion / Divide & Conquer',
  'Hard',
  'Amazon,Microsoft,Google',
  'https://afteracademy.com/problems/median-of-two-sorted-array-of-same-size'],
 ['19.',
  'Inversion count in an array',
  'https://afteracademy.com/blog/inversion-count-in-an-array',
  'Recursion / Divide & Conquer',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/inversion-count-in-an-array'],
 ['20.',
  'Search for a Range in a sorted array',
  'https://afteracademy.com/blog/search-for-a-range-in-sorted-array',
  'Recursion / Divide & Conquer',
  'Easy',
  'Microsoft,Google',
  'https://afteracademy.com/problems/search-for-a-range-in-a-sorted-array'],
 ['21.',
  'Longest Common Prefix',
  'https://afteracademy.com/blog/longest-common-prefix',
  'Recursion / Divide & Conquer',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/longest-common-prefix'],
 ['22.',
  'Median in row wise sorted matrix',
  'https://afteracademy.com/blog/median-in-a-row-wise-sorted-matrix',
  'Recursion / Divide & Conquer',
  'Medium',
  'Amazon',
  'https://afteracademy.com/problems/median-in-row-wise-sorted-matrix'],
 ['23.',
  'Swap List Nodes in pairs',
  'https://afteracademy.com/blog/swap-list-nodes-in-pairs',
  'Linked List',
  'Easy',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/swap-list-nodes-in-pairs'],
 ['24.',
  'Add Two Numbers as Lists',
  'https://afteracademy.com/blog/add-two-numbers-as-lists',
  'Linked List',
  'Medium',
  'Amazon,Microsoft,Facebook',
  'https://afteracademy.com/problems/add-two-numbers-as-lists'],
 ['25.',
  'Check if a singly linked list is palindrome',
  'https://afteracademy.com/blog/check-if-the-singly-linked-list-is-a-palindrome',
  'Linked List',
  'Medium',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/check-if-a-singly-linked-list-is-palindrome'],
 ['26.',
  'Reverse a linked list from position m to n',
  'https://afteracademy.com/blog/reverse-a-linked-list-from-position-m-to-n',
  'Linked List',
  'Medium',
  'Amazon,Microsoft,Facebook',
  'https://afteracademy.com/problems/reverse-linked-list-from-m-to-n'],
 ['27.',
  'Detect and Remove Loop in a Linked List',
  'https://afteracademy.com/blog/detect-and-remove-loop-in-a-linked-list',
  'Linked List',
  'Hard',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/detect-and-remove-loop-in-a-linked-list'],
 ['28.',
  'Merge Two Sorted Lists',
  'https://afteracademy.com/blog/merge-two-sorted-lists',
  'Linked List',
  'Easy',
  'Amazon,Microsoft,Yahoo',
  'https://afteracademy.com/problems/merge-two-sorted-lists'],
 ['29.',
  'Remove Nth Node from List End',
  'https://afteracademy.com/blog/remove-nth-node-from-end-of-list',
  'Linked List',
  'Medium',
  'Amazon',
  'https://afteracademy.com/problems/remove-nth-node-from-list-end'],
 ['30.',
  'Sort a linked list using insertion sort',
  'https://afteracademy.com/blog/sort-a-linked-list-using-insertion-sort',
  'Linked List',
  'Medium',
  'Microsoft,Google',
  'https://afteracademy.com/problems/sort-a-linked-list-using-insertion-sort'],
 ['31.',
  'Find next greater element in an array',
  'https://afteracademy.com/blog/find-the-next-greater-element-for-every-element-in-an-array',
  'Stack and Queue',
  'Medium',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/find-next-greater-element-in-an-array'],
 ['32.',
  'Trapping rain water',
  'https://afteracademy.com/blog/rain-water-trapping',
  'Stack and Queue',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/trapping-rain-water'],
 ['33.',
  'Merge overlapping intervals',
  'https://afteracademy.com/blog/merge-overlapping-intervals',
  'Stack and Queue',
  'Medium',
  'Amazon,Google',
  'https://afteracademy.com/problems/merge-overlapping-intervals'],
 ['34.',
  'Largest Rectangle in Histogram',
  'https://afteracademy.com/blog/largest-rectangle-in-a-histogram',
  'Stack and Queue',
  'Hard',
  'Amazon,Google,Facebook',
  'https://afteracademy.com/problems/largest-rectangle-in-histogram'],
 ['35.',
  'Check for balanced parentheses in an expression',
  'https://afteracademy.com/blog/check-for-balanced-parentheses-in-an-expression',
  'Stack and Queue',
  'Medium',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/check-for-balanced-parentheses-in-an-expression'],
 ['36.',
  'Min Stack Problem',
  'https://afteracademy.com/blog/min-stack-problem',
  'Stack and Queue',
  'Easy',
  'Amazon,Microsoft,Yahoo,Adobe',
  'https://afteracademy.com/problems/min-stack-problem'],
 ['37.',
  'LRU Cache implementation',
  None,
  'Stack and Queue',
  'Hard',
  'Amazon,Microsoft,Adobe,Google',
  'https://afteracademy.com/problems/lru-cache-implementation'],
 ['38.',
  'Sort a stack using another stack',
  'https://afteracademy.com/blog/sort-a-stack-using-another-stack',
  'Stack and Queue',
  'Medium',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/sort-a-stack-using-another-stack'],
 ['39.',
  'Lowest Common Ancestor of a Binary tree',
  'https://afteracademy.com/blog/lowest-common-ancestor-of-a-binary-tree',
  'Binary Tree',
  'Medium',
  'Amazon,Google,Microsoft,Facebook,Adobe',
  'https://afteracademy.com/problems/lowest-common-ancestor-of-a-binary-tree'],
 ['40.',
  'Path sum in binary tree',
  'https://afteracademy.com/blog/path-sum-in-binary-tree',
  'Binary Tree',
  'Easy',
  'Amazon,Microsoft,Yahoo',
  'https://afteracademy.com/problems/path-sum-in-binary-tree'],
 ['41.',
  'Min Depth of Binary Tree',
  'https://afteracademy.com/blog/minimum-depth-of-binary-tree',
  'Binary Tree',
  'Easy',
  'Amazon,Facebook',
  'https://afteracademy.com/problems/min-depth-of-binary-tree'],
 ['42.',
  'Binary Tree Zigzag Level Order Traversal',
  'https://afteracademy.com/blog/binary-tree-zig-zag-level-order-traversal',
  'Binary Tree',
  'Medium',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/binary-tree-zigzag-level-order-traversal'],
 ['43.',
  'Invert Binary Tree',
  'https://afteracademy.com/blog/invert-a-binary-tree',
  'Binary Tree',
  'Medium',
  'Amazon,Google',
  'https://afteracademy.com/problems/invert-binary-tree'],
 ['44.',
  'Flatten Binary Tree to Linked List',
  'https://afteracademy.com/blog/flatten-binary-tree-to-linked-list',
  'Binary Tree',
  'Medium',
  'Amazon,Microsoft,Yahoo,Adobe',
  'https://afteracademy.com/problems/flatten-binary-tree-to-linked-list'],
 ['45.',
  'Find diameter of binary tree',
  'https://afteracademy.com/blog/find-diameter-of-binary-tree',
  'Binary Tree',
  'Medium',
  'Facebook,Google,Amazon',
  'https://afteracademy.com/problems/find-diameter-of-binary-tree'],
 ['46.',
  'All Nodes Distance K in Binary Tree',
  'https://afteracademy.com/blog/all-nodes-distance-k-in-binary-tree',
  'Binary Tree',
  'Medium',
  'Microsoft',
  'https://afteracademy.com/problems/all-nodes-distance-k-in-binary-tree'],
 ['47.',
  'Merge two binary tree',
  'https://afteracademy.com/blog/merge-two-binary-trees',
  'Binary Tree',
  'Easy',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/merge-two-binary-tree'],
 ['48.',
  'Shortest Unique Prefix',
  None,
  'Trie',
  'Hard',
  'Google',
  'https://afteracademy.com/problems/shortest-unique-prefix'],
 ['49.',
  'Sorted Array To Balanced BST',
  'https://afteracademy.com/blog/sorted-array-to-balanced-bst',
  'Binary Search Tree',
  'Easy',
  'Amazon',
  'https://afteracademy.com/problems/sorted-array-to-balanced-bst'],
 ['50.',
  'K-th largest element in BST',
  'https://afteracademy.com/blog/kth-largest-element-in-a-bst',
  'Binary Search Tree',
  'Medium',
  'Amazon',
  'https://afteracademy.com/problems/k-th-largest-element-in-bst'],
 ['51.',
  'Minimum absolute difference in BST',
  'https://afteracademy.com/blog/minimum-absolute-difference-in-a-bst',
  'Binary Search Tree',
  'Easy',
  'Google',
  'https://afteracademy.com/problems/minimum-absolute-difference-in-bst'],
 ['52.',
  'Recover Binary Search Tree',
  'https://afteracademy.com/blog/recover-binary-search-tree',
  'Binary Search Tree',
  'Hard',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/recover-binary-search-tree'],
 ['53.',
  'Merge Two BST',
  'https://afteracademy.com/blog/merge-two-bst',
  'Binary Search Tree',
  'Medium',
  'Google,Amazon,Microsoft',
  'https://afteracademy.com/problems/merge-two-bst'],
 ['54.',
  'Lowest Common Ancestor of a BST',
  'https://afteracademy.com/blog/lowest-common-ancestor-of-a-binary-search-tree',
  'Binary Search Tree',
  'Medium',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/lowest-common-ancestor-of-a-bst'],
 ['55.',
  'K Pairs with Smallest Sums',
  None,
  'Heap / Priority Queue',
  'Medium',
  'Google',
  'https://afteracademy.com/problems/k-pairs-with-smallest-sums'],
 ['56.',
  'Sliding window maximum',
  'https://afteracademy.com/blog/sliding-window-maximum',
  'Heap / Priority Queue',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/sliding-window-maximum'],
 ['57.',
  'Merge K sorted list',
  'https://afteracademy.com/blog/merge-k-sorted-lists',
  'Heap / Priority Queue',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/merge-k-sorted-list'],
 ['58.',
  'Convert a min heap to max heap',
  'https://afteracademy.com/blog/convert-a-min-heap-to-a-max-heap',
  'Heap / Priority Queue',
  'Medium',
  'Google',
  'https://afteracademy.com/problems/convert-a-min-heap-to-max-heap'],
 ['59.',
  'Check if two arrays are equal or not',
  'https://afteracademy.com/blog/check-if-two-arrays-are-equal-or-not',
  'Hash Table',
  'Easy',
  'Amazon,Goldman Sachs',
  'https://afteracademy.com/problems/check-if-two-arrays-are-equal-or-not'],
 ['60.',
  'Intersection of two unsorted array',
  'https://afteracademy.com/blog/find-the-intersection-of-two-unsorted-arrays',
  'Hash Table',
  'Medium',
  'Google,Facebook',
  'https://afteracademy.com/problems/intersection-of-two-unsorted-array'],
 ['61.',
  'Longest Consecutive Sequence',
  'https://afteracademy.com/blog/longest-consecutive-sequence',
  'Hash Table',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/longest-consecutive-sequence'],
 ['62.',
  'Valid Anagram',
  'https://afteracademy.com/blog/valid-anagram',
  'Hash Table',
  'Medium',
  'Google,Amazon,Microsoft',
  'https://afteracademy.com/problems/valid-anagram'],
 ['63.',
  'Majority Element',
  'https://afteracademy.com/blog/find-the-majority-element-in-an-array',
  'Hash Table',
  'Medium',
  'Amazon,Microsoft,Yahoo,Google',
  'https://afteracademy.com/problems/majority-element'],
 ['64.',
  'Sort Characters by Frequency',
  'https://afteracademy.com/blog/sort-characters-by-frequency',
  'Hash Table',
  'Medium',
  'Facebook,Google',
  'https://afteracademy.com/problems/sort-characters-by-frequency'],
 ['65.',
  'First Unique Character in a String',
  'https://afteracademy.com/blog/first-unique-character-in-a-string',
  'Hash Table',
  'Easy',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/first-unique-character-in-a-string'],
 ['66.',
  'Triplet with zero sum',
  'https://afteracademy.com/blog/triplet-with-zero-sum',
  'Hash Table',
  'Medium',
  'Facebook,Amazon,Microsoft',
  'https://afteracademy.com/problems/triplet-with-zero-sum'],
 ['67.',
  'First missing positive',
  'https://afteracademy.com/blog/find-missing-positive',
  'Hash Table',
  'Medium',
  'Amazon',
  'https://afteracademy.com/problems/first-missing-positive'],
 ['68.',
  'Largest subarray with 0 sum',
  'https://afteracademy.com/blog/find-the-length-of-largest-subarray-with-0-sum',
  'Hash Table',
  'Hard',
  'Microsoft',
  'https://afteracademy.com/problems/largest-subarray-with-0-sum'],
 ['69.',
  'Max points on the straight line',
  'https://afteracademy.com/blog/max-points-on-the-straight-line',
  'Hash Table',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/max-points-on-the-straight-line'],
 ['70.',
  'Climbing Stairs Problem',
  'https://afteracademy.com/blog/climbing-stairs-problem',
  'Dynamic Programming',
  'Easy',
  'Amazon,Google',
  'https://afteracademy.com/problems/climbing-stairs-problem'],
 ['71.',
  'Matrix Chain Multiplication',
  'https://afteracademy.com/blog/matrix-chain-multiplication',
  'Dynamic Programming',
  'Hard',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/matrix-chain-multiplication'],
 ['72.',
  'Longest Increasing subsequence',
  'https://afteracademy.com/blog/longest-increasing-subsequence',
  'Dynamic Programming',
  'Medium',
  'Amazon,Microsoft,Facebook',
  'https://afteracademy.com/problems/longest-increasing-subsequence'],
 ['73.',
  'Partition Equal Subset Sum',
  'https://afteracademy.com/blog/partition-equal-subset-sum',
  'Dynamic Programming',
  'Medium',
  'Amazon,Adobe',
  'https://afteracademy.com/problems/partition-equal-subset-sum'],
 ['74.',
  'Minimum number of jumps to reach end',
  'https://afteracademy.com/blog/minimum-number-of-jumps-to-reach-end',
  'Dynamic Programming',
  'Hard',
  'Amazon,Google,Ebay',
  'https://afteracademy.com/problems/minimum-number-of-jumps-to-reach-end'],
 ['75.',
  'Interleaving String',
  'https://afteracademy.com/blog/interleaving-strings',
  'Dynamic Programming',
  'Hard',
  'Google,Microsoft,Yahoo',
  'https://afteracademy.com/problems/interleaving-string'],
 ['76.',
  'Coin change problem',
  'https://afteracademy.com/blog/minimum-coin-change',
  'Dynamic Programming',
  'Medium',
  'Microsoft',
  'https://afteracademy.com/problems/coin-change-problem'],
 ['77.',
  'Edit distance Problem',
  'https://afteracademy.com/blog/edit-distance-problem',
  'Dynamic Programming',
  'Hard',
  'Amazon,Google,Microsoft',
  'https://afteracademy.com/problems/edit-distance-problem'],
 ['78.',
  'Min Cost Path',
  'https://afteracademy.com/blog/minimum-cost-path',
  'Dynamic Programming',
  'Medium',
  'Amazon',
  'https://afteracademy.com/problems/min-cost-path'],
 ['79.',
  'Maximal Square',
  'https://afteracademy.com/blog/maximal-square',
  'Dynamic Programming',
  'Medium',
  'Google,Microsoft',
  'https://afteracademy.com/problems/maximal-square'],
 ['80.',
  'Longest Arithmetic Progression',
  'https://afteracademy.com/blog/longest-arithmetic-progression',
  'Dynamic Programming',
  'Medium',
  'Google,Microsoft',
  'https://afteracademy.com/problems/longest-arithmetic-progression'],
 ['81.',
  'Word break problem',
  None,
  'Dynamic Programming',
  'Hard',
  'Facebook,Google',
  'https://afteracademy.com/problems/word-break-problem'],
 ['82.',
  'Maximum Subarray Sum',
  'https://afteracademy.com/blog/maximum-subarray-sum',
  'Dynamic Programming',
  'Medium',
  'Amazon,Microsoft,Yahoo,Facebook',
  'https://afteracademy.com/problems/maximum-subarray-sum'],
 ['83.',
  'Palindrome Partitioning',
  None,
  'Dynamic Programming',
  'Hard',
  'Amazon,Google',
  'https://afteracademy.com/problems/palindrome-partitioning'],
 ['84.',
  'Max Product Subarray',
  'https://afteracademy.com/blog/max-product-subarray',
  'Dynamic Programming',
  'Medium',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/max-product-subarray'],
 ['85.',
  'Maximum Product of Three Numbers',
  'https://afteracademy.com/blog/maximum-product-of-three-numbers',
  'Dynamic Programming',
  'Medium',
  'Amazon',
  'https://afteracademy.com/problems/maximum-product-of-three-numbers'],
 ['86.',
  'Gas station Problem',
  'https://afteracademy.com/blog/gas-station-problem',
  'Greedy Algorithms',
  'Medium',
  'Amazon,Google',
  'https://afteracademy.com/problems/gas-station-problem'],
 ['87.',
  'Distribute Candy Problem',
  'https://afteracademy.com/blog/distribute-candy-problem',
  'Greedy Algorithms',
  'Easy',
  'Amazon,Microsoft',
  'https://afteracademy.com/problems/distribute-candy-problem'],
 ['88.',
  'Fractional Knapsack problem',
  'https://afteracademy.com/blog/fractional-knapsack-problem',
  'Greedy Algorithms',
  'Medium',
  'Amazon',
  'https://afteracademy.com/problems/fractional-knapsack-problem'],
 ['89.',
  'Sudoku Solver',
  'https://afteracademy.com/blog/sudoku-solver',
  'Backtracking',
  'Hard',
  'Amazon,Google,Microsoft',
  'https://afteracademy.com/problems/sudoku-solver'],
 ['90.',
  'Generate Parentheses',
  'https://afteracademy.com/blog/generate-parentheses',
  'Backtracking',
  'Medium',
  'Facebook,Microsoft',
  'https://afteracademy.com/problems/generate-parentheses'],
 ['91.',
  'Print all subset',
  'https://afteracademy.com/blog/print-all-subsets-of-a-given-set',
  'Backtracking',
  'Medium',
  'Amazon,Microsoft,Facebook',
  'https://afteracademy.com/problems/print-all-subset'],
 ['92.',
  'Combination Sum',
  'https://afteracademy.com/blog/combination-sum',
  'Backtracking',
  'Medium',
  'Amazon,Facebook,Adobe',
  'https://afteracademy.com/problems/combination-sum'],
 ['93.',
  'Combinations',
  'https://afteracademy.com/blog/combinations',
  'Backtracking',
  'Medium',
  'Amazon,Adobe',
  'https://afteracademy.com/problems/combinations'],
 ['94.',
  'Letter Combinations of a Phone Number',
  None,
  'Backtracking',
  'Hard',
  'Google',
  'https://afteracademy.com/problems/letter-combinations-of-a-phone-number'],
 ['95.',
  'Word ladder problem',
  'https://afteracademy.com/blog/word-ladder-problem',
  'Graph Algorithms',
  'Medium',
  'Google,Microsoft,Ebay',
  'https://afteracademy.com/problems/word-ladder-problem'],
 ['96.',
  'Smallest Multiple With 0 and 1',
  'https://afteracademy.com/blog/smallest-multiple-with-0-and-1',
  'Graph Algorithms',
  'Hard',
  'Amazon',
  'https://afteracademy.com/problems/smallest-multiple-with-0-and-1'],
 ['97.',
  'Check loop in array according to given constraints',
  None,
  'Graph Algorithms',
  'Medium',
  'Google,Amazon',
  'https://afteracademy.com/problems/check-loop-in-array-according-to-given-constraints'],
 ['98.',
  'Course Schedule',
  None,
  'Graph Algorithms',
  'Hard',
  'Amazon',
  'https://afteracademy.com/problems/course-schedule'],
 ['99.',
  'Knight on chessboard',
  'https://afteracademy.com/blog/knight-on-chessboard',
  'Graph Algorithms',
  'Hard',
  'Amazon,Goldman Sachs',
  'https://afteracademy.com/problems/knight-on-chessboard'],
 ['100.',
  'Surrounded regions',
  'https://afteracademy.com/blog/surrounded-regions',
  'Graph Algorithms',
  'Hard',
  'Google',
  'https://afteracademy.com/problems/surrounded-regions']]
df = pd.DataFrame(body_content, columns = headers)  
df['asked'] = df['Companies'].str.split(',').agg(len)
df
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
    vertical-align: top;
}

.dataframe thead th {
    text-align: right;
}
</style>
# Title Solution Topic Difficulty Companies Problems asked
0 1. Roman To Integer https://afteracademy.com/blog/convert-roman-nu... Mathematical Algorithms Medium Amazon,Microsoft,Facebook https://afteracademy.com/problems/roman-to-int... 3
1 2. Reverse Bits https://afteracademy.com/blog/reverse-bits Mathematical Algorithms Easy Amazon https://afteracademy.com/problems/reverse-bits 1
2 3. Square Root of Integer https://afteracademy.com/blog/find-the-square-... Mathematical Algorithms Medium Amazon,Microsoft,Facebook https://afteracademy.com/problems/square-root-... 3
3 4. Calculate power function https://afteracademy.com/blog/calculate-power-... Mathematical Algorithms Easy Google,LinkedIn,Amazon https://afteracademy.com/problems/calculate-po... 3
4 5. Greatest Common Divisor https://afteracademy.com/blog/greatest-common-... Mathematical Algorithms Medium Google https://afteracademy.com/problems/greatest-com... 1
... ... ... ... ... ... ... ... ...
95 96. Smallest Multiple With 0 and 1 https://afteracademy.com/blog/smallest-multipl... Graph Algorithms Hard Amazon https://afteracademy.com/problems/smallest-mul... 1
96 97. Check loop in array according to given constra... None Graph Algorithms Medium Google,Amazon https://afteracademy.com/problems/check-loop-i... 2
97 98. Course Schedule None Graph Algorithms Hard Amazon https://afteracademy.com/problems/course-schedule 1
98 99. Knight on chessboard https://afteracademy.com/blog/knight-on-chessb... Graph Algorithms Hard Amazon,Goldman Sachs https://afteracademy.com/problems/knight-on-ch... 2
99 100. Surrounded regions https://afteracademy.com/blog/surrounded-regions Graph Algorithms Hard Google https://afteracademy.com/problems/surrounded-r... 1

100 rows × 8 columns

df.to_csv('tech_quest.csv', index=False)
df['Companies']
0     Amazon,Microsoft,Facebook
1                        Amazon
2     Amazon,Microsoft,Facebook
3        Google,LinkedIn,Amazon
4                        Google
                ...            
95                       Amazon
96                Google,Amazon
97                       Amazon
98         Amazon,Goldman Sachs
99                       Google
Name: Companies, Length: 100, dtype: object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment