This problem was asked by Pinterest. Given an integer list where each number represents the number of hops, you can make, determine whether you can reach to the last index starting at index 0. For example, [2, 0, 1, 0] …

#### Code with Narendran Articles.

Here’s a new coding problem for today. This problem was asked by Google. Given a sorted list of integers, square the elements and give the output in sorted order. For example, given [-9, -2, 0, 2, 3], return [0, 4, …

This problem was asked by Google. Given a string, return the first recurring character in it, or null if there is no recurring character. For example, given the string “acbbac”, return “b”. Given the string “abcdef”, return null. Solution: To …

Problem: A natural number is said to be a Narcissistic Number if the sum of its digits each raised to the power of the total number of digits is equal to that number. eg. 153 = 1^3 + 5^3 + …

The power set of a set is the set of all its subsets. Write a function that, given a set, generates its power set. For example, given the set {1, 2, 3}, it should return {{}, {1}, {2}, {3}, {1, …

Given an integer list where each number represents the number of hops, you can make, determine whether you can reach to the last index starting at index 0. For example, [2, 0, 1, 0] returns true while [1, 1, 0, 1] returns false. Problem Explanation: In the …

Coding Problem: Write a function that rotates a list by k elements. For example, [1, 2, 3, 4, 5, 6] rotated by two becomes [3, 4, 5, 6, 1, 2]. Try solving this without creating a copy of the list/array.

Run-length encoding is a fast and simple method of encoding strings. The basic idea is to represent repeated successive characters as a single count and character. For example, the string "AAAABBBCCDAA" would be encoded as "4A3B2C1D2A".

Ruby Coding Problem: Given an array of strictly the characters ‘R’, ‘G’, and ‘B’, segregate the values of the array so that all the Rs come first, the Gs come second, and the Bs come last. You can only swap …

Coding Problem: Given an array of integers, write a function to determine whether the array could become non-decreasing by modifying at most 1 element. For example, given the array [10, 5, 7], you should return true, since we can modify the …