This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
OlderNewer