skip to main | skip to sidebar

techRiddler

Brain-teasers and technical questions that interviewers use to challenge your logic and problem solving skills.

Friday, March 10, 2006

Unmatched number

An array has pairs of positive integers in random order. One integer is accidently changed to -1. Return the array to its original state.

O(n) time.
O(1) space.
Posted by Waiki at 11:42 AM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2008 (1)
    • ►  Jan (1)
  • ►  2007 (2)
    • ►  Dec (1)
    • ►  Jul (1)
  • ▼  2006 (17)
    • ►  Nov (1)
    • ►  Oct (1)
    • ►  May (1)
    • ▼  Mar (14)
      • Explain OO
      • Measuring Search Quality
      • k closest points to the origin
      • Find a sum in an array
      • Unique, Union, Intersection
      • open and closing doors
      • Unmatched number
      • final, finally, finalize [java]
      • Spinning Disk
      • atoi
      • Stacks and Queues
      • Processes in *nix
      • Reverse a linked list
      • Breaking a linked list with a cycle
  • ►  2005 (12)
    • ►  Dec (12)