← Swiggy questions

Generate f12() from f6()

Filed under Swiggy

Given a function f6() that returns integers from 1 to 6 uniformly at random, implement a function f12() that returns integers from 1 to 12 uniformly at random.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Swiggy questions

Collected from public candidate posts and coding forums. Updated Nov 2026.