Palindrome Number

July 18, 2019 by Sandeep Bhardwaj | Tags:

Palindrome Number /** * 9. Palindrome Number * <p> * Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. * <p> * Example 1: * <p> * Input: 121 * Output: true * Example 2: * <p> * Input: -121 * Ou...

Read more

Middle of the Linked List

July 17, 2019 by Sandeep Bhardwaj | Tags:

Middle of the Linked List /** * 876. Middle of the Linked List * <p> * Given a non-empty, singly linked list with head node head, return a middle node of linked list. * <p> * If there are two middle nodes, return the second middle node. * <p> * Example 1: * <p> *...

Read more

Longest Substring Without Repeating Characters

July 16, 2019 by Sandeep Bhardwaj | Tags:

Longest Substring Without Repeating Characters /** * 3. Longest Substring Without Repeating Characters * <p> * Given a string, find the length of the longest substring without repeating characters. * <p> * Example 1: * <p> * Input: "abcabcbb" * Output: 3 * Explanation:...

Read more

Detect loop in linked list

July 15, 2019 by Sandeep Bhardwaj | Tags:

Detect loop in linked list /** * 141. Linked List Cycle * <p> * Given a linked list, determine if it has a cycle in it. * <p> * To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the * linked list where tail connect...

Read more

Find the smallest missing positive integer

July 14, 2019 by Sandeep Bhardwaj | Tags:

Find the smallest missing positive integer /** * 41. First Missing Positive * <p> * Given an unsorted integer array, find the smallest missing positive integer. * <p> * Example 1: * <p> * Input: [1,2,0] * Output: 3 * Example 2: * <p> * Input: [3,4,-1,1] * Outp...

Read more