Regular Expressions (Regex) are very powerful and useful tool to describe patterns. https://leetcode.com/problems/valid-phone-numbers/ Given a text file file.txt that contains list of phone numbers (one per line), write a …
April 15, 2015
algorithms, BFS, Breadth First Search, c / c++, Depth First Search, DFS, Dynamic Programming, dynamic programming, Memoization, python, Recursion
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each …
Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. +----+------------------+ | Id | Email …
Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates. +---------+------------+------------------+ | Id(INT) | Date(DATE) | Temperature(INT) …
How would you print just the 10th line of a file? For example, assume that file.txt has the following content: Line 1 Line 2 Line 3 Line 4 Line …
Given an index k, return the k-th row of the Pascal’s triangle. For example, given k = 3, Return . Could you optimize your algorithm to use only O(k) …