1. Numbers Appearing Only Oncehistorical

    In an integer array, every number appears twice except for two numbers. Write a program to find the two numbers that appear only once.

  2. Remove Duplicates from Sorted List IIhistorical

    Given the head head of a sorted linked list, delete all nodes whose values are duplicated, leaving only values that appear once. Return the sorted linked list.

  3. Inverse Pairs in an Arrayhistorical

    An inversion occurs when an earlier array element is greater than a later one. Count all inversions in the given array.

  4. Remove Duplicates from Sorted Listhistorical

    Given the head head of a sorted linked list, delete duplicate elements so that each value appears only once. Return the sorted linked list.

  5. Duplicate Number in an Arrayhistorical

    An array of length n contains values from 0 to n - 1, with some values repeated. Find a duplicate value.

  6. Remove Nth Node From End of Listhistorical

    Given a linked list, remove the nth node from the end and return the head of the list. For example, given the linked list: 1->2->3->4->5, n = 2. after removing the nth node from the end, the list becomes 1->2->3->5.

  7. Minimum Number in a Rotated Arrayhistorical

    Moving some elements from the beginning of an array to the end is called a rotation of the array. Given a rotation of a non-decreasingly sorted array, output the minimum element of the rotated array.

  8. Palindrome Linked Listhistorical

    Determine whether a linked list is a palindrome.

  9. Smallest K Numbershistorical

    Given n integers, find the smallest K numbers. For example, among 4,5,1,6,2,7,3,8, the smallest four numbers are 1,2,3,4.

  10. Palindrome Linked Listhistorical

    Determine whether a linked list is a palindrome.