LeetCode 344: Reverse String
Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello"
, return "olleh"
.
Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello"
, return "olleh"
.
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit.
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up: Can you solve it without using extra space?
Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?