cpp-map

- cpp-map, Hash, Mathematical, Strings

Max count of N using digits of M such that 2 and 5, and, 6 and 9 can be treated as same respectively

  import java.util.HashMap;import java.util.Map;  public class GFG {                  int solve(int n, String str)    {                          HashMap mymap            = new HashMap();                  int len = str.length();                  for (int i = 0;…

Read More

- Algorithms, BFS, Binary Tree, cpp-map, cpp-queue, cpp-random, Queue, Randomized, Tree

Test Case Generation | Set 6 (Random Unweighted Binary Tree)

  #include using namespace std;    vector generateBinaryTree(int n){                        vector options = { 0, 1, 2 };                        map mp;                queue q;            q.push(1);            vector v;                int count = 1;                mp[1] =…

Read More