Category: programming languages
Given two integers L and R, find the count of numbers in the range (inclusive) having a prime number of set bits in their binary representation. (Recall that the …
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order …
Let’s say we want to put a REL=NOFOLLOW on all external links in your wordpress posts/pages, we can add a filter to parse the content using the regular expression …
Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level X …
You have some sticks with positive integer lengths. You can connect any two sticks of lengths X and Y into one stick by paying a cost of X + …