Algorithms

Zigzag Conversion

[tabby title="Task"] The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want ...

Longest Common Substring

[tabby title="Task"] Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0. A subsequence of a string is ...

Copy List with Random Pointer

[tabby title="Task"] A linked list of length n is given such that each node contains an additional random pointer, which could point ...

Implement pow(x, n)

[tabby title="Task"] Implement pow(x, n), which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 ...

Longest Common Prefix

[tabby title="Task"] Write a function to find the longest common prefix string amongst an array of strings. If there is ...
/ algorithms, Algorithms, java script, TUTORIALS

Roman to Integer

[tabby title="Task"] Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol                Value I ...
/ algorithms, Algorithms, java script, TUTORIALS

Container With Most Water

[tabby title="Task"] Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that ...
/ algorithms, Algorithms, java script, TUTORIALS

Unique-paths

[tabby title="Task"] A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot ...

Intersection of Two Linked Lists

[tabby title="Task"] Write a program to find the node at which the intersection of two singly linked lists begins. For ...

Check if string has all unique characters

[tabby title="Task"] Implement an algorithm to determine if a string (of characters from ‘a’ to ‘z’) has all unique characters ...