Kirat

Kirat

[Solved] How to extract an array from string input?

Introduction Solution You can split the string and then iterate over the array. Which results in something like this: String input = “3 12#45#33 94#54#23 98#59#27″; String[] strings = input.split(” “); int size = Integer.parseInt(strings[0]); int[][] result = new int[size][size];…

[Solved] Pivot element – c++/c

Introduction Solution #include<iostream> using namespace std; void initarray(int a[], int n) { for(int i = 0; i<n; i++) { a[i]=0; } } void acceptarray(int a[], int n) { for(int i = 0; i<n; i++) { cin >> a[i]; } }…

[Solved] Array iteration in javascript

Introduction Solution So I know you are talking about arrays in your post but your “array” you give to us is actually an object. Major shocker, I know… Notice the array [ ] vs object { } brackets. But this…