Hint: Binary search is mostly used for this kind of questions. The simplest form of this question would be finding pivot element, which requires you to find an index in an array that makes the sum of all elements to its left equals to the sum of all elements to its right. Leetcode 724: Find… Continue reading BLOG | Split an array into k subarrays
Blog
BLOG | Inverted index: search keywords in a list of documents
Given a list of documents and a list of keywords, how do we find all documents containing one or multiple keywords? For this question, we tokenize all documents into terms, and create a inverted index where each term is associated with a list of documents that contains that term. We use this information to rank… Continue reading BLOG | Inverted index: search keywords in a list of documents
BLOG | Comparing attributes for a set of cards
Question: SET is a card game where each card has 3 attributes, each of which can take on 3 different values(0,1,2). A "valid SET" is 3 cards such that each attribute is either (a) all the same or (b) all different.Example: card1 = {0,1,2} card2 = {0,0,1} card3 = {0,2,0} is a valid set.Write a… Continue reading BLOG | Comparing attributes for a set of cards



