Quora | On-site New Grad 2022 | Sequence of Strings
Anonymous User
217

given this sequence of strings
// n - f(n)
// 0 - ""
// 1 - "0"
// 2 - "1"
// 3 - "00"
// 4 - "01"
// 5 - "10"
// 6 - "11"
// 7 - "000"
// 8 - "001"
// 9 - "010"
// 10 - "011"
// 11 - "100"
// 12 - "101"
// 13 - "110"
// 14 - "111"
// 15 - "0000"
// ...
write a function that takes an integer n and produces the nth string in the sequence

Comments (2)