Skip to content

Files

Latest commit

670358f · Apr 23, 2020

History

History
14 lines (6 loc) · 447 Bytes

README.md

File metadata and controls

14 lines (6 loc) · 447 Bytes

Daily Coding Problem: Problem #51

Good morning! Here's your coding interview problem for today.

This problem was asked by Facebook.

Given a function that generates perfectly random numbers between 1 and k (inclusive), where k is an input, write a function that shuffles a deck of cards represented as an array using only swaps.

It should run in O(N) time.

Hint: Make sure each one of the 52! permutations of the deck is equally likely.