Skip to content

Instantly share code, notes, and snippets.

View gkastrinis's full-sized avatar
🦄
Chasing Unicorns

George Kastrinis gkastrinis

🦄
Chasing Unicorns
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
// num is the original number
// i is the current digit
// digits is the total number of digits in num
// mask is a number with 'digits' length of 1 and 0
void solve(int num, int i, int digits, int mask, int maxOne) {
// combine mask and num and print only the digits of num
// in the places where mask has 1