# Post Only Coding Problems & Solutions Here | All Coding Guru's Dig In

**URL:** <https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680>\
**Category:** Discussion & Solutions\
**Tags:** business\
**Created:** [October 20, 2019, 9:23am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680 "2019-10-20T09:23:31Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![Mayank](https://onehack.st/user_avatar/onehack.st/mayank/32/18032_2.png) [@Mayank](https://onehack.st/u/Mayank)\
**Post date:** [November 3, 2019, 8:57am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/67 "2019-11-03T08:57:43Z")

</div>

for problem 11  
pseudocode:

```auto
func multiplicative_peristence(num)
  count = 0
  while num > 9
    count = count + 1
    num = multOfNumber(num)
  end while
return count;
end func

func multOfNumber(num)
  mul = 1
  while num != 0
     mul *= num%10
     num = num / 10 (removing decimal )
   end while
return mul;
end func
```

---

<div class="post-metadata">

**Author:** ![Mayank](https://onehack.st/user_avatar/onehack.st/mayank/32/18032_2.png) [@Mayank](https://onehack.st/u/Mayank)\
**Post date:** [November 4, 2019, 8:34am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/69 "2019-11-04T08:34:15Z")

</div>

**Problem 12**  
level : Easy  
Expected soln :  
time complexity: log(a)  
space complexity: O(1)

Given two integers `dividend` and `divisor` , divide two integers without using multiplication, division and mod operator.

Return the quotient after dividing `dividend` by `divisor` .

The integer division should truncate toward zero.

**Example 1:**

**Input:** dividend = 10, divisor = 3 **Output:** 3

**Example 2:**

**Input:** dividend = 7, divisor = -3 **Output:** -2

**Note:**

- Both dividend and divisor will be 32-bit signed integers.
- The divisor will never be 0.
- Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For the purpose of this problem, assume that your function returns 231 − 1 when the division result overflows.

---

<div class="post-metadata">

**Author:** ![Mayank](https://onehack.st/user_avatar/onehack.st/mayank/32/18032_2.png) [@Mayank](https://onehack.st/u/Mayank)\
**Post date:** [November 12, 2019, 7:43pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/75 "2019-11-12T19:43:00Z")

</div>

problem 13:  
via pattern matching  
\d+ for integer  
\d+\.\d+ for float  
rest is string  
what does something else mean?

---

<div class="post-metadata">

**Author:** ![dydx](https://onehack.st/user_avatar/onehack.st/dydx/32/36729_2.png) [@dydx](https://onehack.st/u/dydx)\
**Post date:** [November 12, 2019, 1:45pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/72 "2019-11-12T13:45:18Z")

</div>

**Hello world…**  
**What would be your thought process on this problem**

let say

**input** A = [3]  
**output** = [FALSE]

**input** A = [3,3]  
**output** = [FALSE, TRUE]

**input** A = [1,2,1]  
**output** =[FALSE, FALSE, TRUE]

**input** A = [1,2,3]  
**output** = [FALSE, FALSE, FALSE]

**input** A = [1,1,1]  
**output** = [FALSE, TRUE, TRUE]

**input** A = [1,2,3,4,1,3,4,5]  
**output** [FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE]

**input** A = [3,2,6,3,7]  
**output** [FALSE, FALSE, FALSE , TRUE, FALSE]

it just check duplicates of element and return logical vector

---

<div class="post-metadata">

**Author:** ![nikhilknick](https://onehack.st/user_avatar/onehack.st/nikhilknick/32/22060_2.png) [@nikhilknick](https://onehack.st/u/nikhilknick)\
**Post date:** [November 12, 2019, 4:22pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/73 "2019-11-12T16:22:21Z")

</div>

Code in javascript

```
    const duplicateTrue = (arr) =>{
    let final = [];                  
    for(let i =0;i<arr.length;i++){
     let s = arr.slice(0,i);          
      if(s.includes(arr[i]))
      final.push(true);
    else
        final.push(false);
      }
    return final;
    }

```

---

<div class="post-metadata">

**Author:** ![Mayank](https://onehack.st/user_avatar/onehack.st/mayank/32/18032_2.png) [@Mayank](https://onehack.st/u/Mayank)\
**Post date:** [November 12, 2019, 6:35pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/74 "2019-11-12T18:35:25Z")

</div>

problem 14:  
using hashtable  
and having  
space complexity of O(n) + O(n) for space and  
time complexity O(n) .

---

<div class="post-metadata">

**Author:** ![Magnus](https://onehack.st/user_avatar/onehack.st/magnus/32/26177_2.png) [@Magnus](https://onehack.st/u/Magnus)\
**Post date:** [November 13, 2019, 9:43am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/76 "2019-11-13T09:43:01Z")

</div>

Problem 15:  
Print the pattern without using loops:

input: 12,4:  
output:  
12, 8 , 4 , 0, 4, 8,12

input: 10,3:  
output:  
10 7 4 1 -2 1 4 7 10

---

<div class="post-metadata">

**Author:** ![Ak\_Malviya](https://onehack.st/user_avatar/onehack.st/ak_malviya/32/23188_2.png) [@Ak\_Malviya](https://onehack.st/u/Ak_Malviya)\
**Post date:** [November 17, 2019, 6:04pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/81 "2019-11-17T18:04:17Z")

</div>

```
#include<iostream>
#include<stdlib.h>
using namespace std;
void chck(int a,int b);
void chck_nxt(int a,int b);
int x,y;
int main()
{
    cout<<"Enter Value of x";
    cin>>x;
    cout<<"Enter Value of y";
    cin>>y;
    cout<<"\n"<<x;
    chck(x,y);

}

void chck(int a,int b)
{
    int t1= a-b;
    cout<<"\n"<<t1;
    if(t1<=0)
    {
        chck_nxt(t1,b);
    }
    else
    {
        chck(t1,b);
    }
}
void chck_nxt(int a,int b)
{
    int t2 =a +b;
cout<<"\n"<<t2;
    if(t2==x)
    {

    }
    else
    {
        chck_nxt(t2,b);
    }
}

```

This will help you to solve your problem.

---

<div class="post-metadata">

**Author:** ![Mayank](https://onehack.st/user_avatar/onehack.st/mayank/32/18032_2.png) [@Mayank](https://onehack.st/u/Mayank)\
**Post date:** [November 18, 2019, 6:58pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/83 "2019-11-18T18:58:35Z")

</div>

wont it lead to stackoverflow for large value of A and small value of B?  
for the input A,B on the first line.

---

<div class="post-metadata">

**Author:** ![Ak\_Malviya](https://onehack.st/user_avatar/onehack.st/ak_malviya/32/23188_2.png) [@Ak\_Malviya](https://onehack.st/u/Ak_Malviya)\
**Post date:** [November 19, 2019, 11:33am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/84 "2019-11-19T11:33:32Z")

</div>

I haven’t used any stack. Then, how it will lead to stack overflow?  
Please explain.

---

<div class="post-metadata">

**Author:** ![Mayank](https://onehack.st/user_avatar/onehack.st/mayank/32/18032_2.png) [@Mayank](https://onehack.st/u/Mayank)\
**Post date:** [November 19, 2019, 5:40pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/87 "2019-11-19T17:40:58Z")

</div>

> From GeeksForGeeks  
> **How memory is allocated to different function calls in recursion?**  
> When any function is called from main(), the memory is allocated to it on the stack. A recursive function calls itself, the memory for a called function is allocated on top of memory allocated to calling function and different copy of local variables is created for each function call. When the base case is reached, the function returns its value to the function by whom it is called and memory is de-allocated and the process continues.

Thats one of the reason where its better for bottom up approach.  
PS could have PM’d but lot of folks don’t have a clue how recursion works. Sorry Modz

Reference  
`https://www.geeksforgeeks.org/recursion/`

---

<div class="post-metadata">

**Author:** ![Ak\_Malviya](https://onehack.st/user_avatar/onehack.st/ak_malviya/32/23188_2.png) [@Ak\_Malviya](https://onehack.st/u/Ak_Malviya)\
**Post date:** [November 22, 2019, 8:53am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/89 "2019-11-22T08:53:29Z")

</div>

Thank you for letting me know how recursion works.

---

<div class="post-metadata">

**Author:** ![dydx](https://onehack.st/user_avatar/onehack.st/dydx/32/36729_2.png) [@dydx](https://onehack.st/u/dydx)\
**Post date:** [April 25, 2020, 6:22pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/101 "2020-04-25T18:22:55Z")

</div>

```
#include <stdio.h>

void pattern(int num, int diff) {

    if (num <= 0) {
        printf(" %d ", num);
        return;
    }
    else {
        printf("%d ", num);
        pattern(num - diff, diff);
        printf(" %d", num);
    }
}

int main(void) {
    pattern(12, 4);
    printf("\n");
    pattern(10, 3);
    return 0;
}

```

 ![image](https://onehack.st/uploads/default/original/3X/d/2/d24a26d83c1069e22b8e383231a8a7fb2361cd39.png)

---

<div class="post-metadata">

**Author:** ![dydx](https://onehack.st/user_avatar/onehack.st/dydx/32/36729_2.png) [@dydx](https://onehack.st/u/dydx)\
**Post date:** [April 25, 2020, 6:25pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/102 "2020-04-25T18:25:49Z")

</div>

you are not using recursion to its fullest !

---

<div class="post-metadata">

**Author:** ![reegan29](https://onehack.st/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@reegan29](https://onehack.st/u/reegan29)\
**Post date:** [November 13, 2019, 12:07pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/78 "2019-11-13T12:07:26Z")

</div>

Need to solve this with JAVA.

anagrams:

**input data:**  
act  
cat  
tree  
race  
care  
acre  
bee

**the output should be:**  
act cat  
acre care race

---

<div class="post-metadata">

**Author:** ![Ak\_Malviya](https://onehack.st/user_avatar/onehack.st/ak_malviya/32/23188_2.png) [@Ak\_Malviya](https://onehack.st/u/Ak_Malviya)\
**Post date:** [November 17, 2019, 6:15pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/82 "2019-11-17T18:15:43Z")

</div>

Please Give this Problem, 16 number.

---

<div class="post-metadata">

**Author:** ![JCKNIGHT](https://onehack.st/user_avatar/onehack.st/jcknight/32/18176_2.png) [@JCKNIGHT](https://onehack.st/u/JCKNIGHT)\
**Post date:** [November 16, 2019, 4:38pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/80 "2019-11-16T16:38:14Z")

</div>

Can anyone assist me in completing a cryptography code . Which should have a client and server?

---

<div class="post-metadata">

**Author:** ![Darklooter](https://onehack.st/user_avatar/onehack.st/darklooter/32/1882_2.png) [@Darklooter](https://onehack.st/u/Darklooter)\
**Post date:** [November 19, 2019, 11:59am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/85 "2019-11-19T11:59:10Z")

</div>

Can anyone share a sample resources to learn hashtables , hashmaps like youtube link or sample problems. I am having a hard time understanding it I get the concept of key value but I’m having hard time implementing it in my solutions or using it.

Ps, do not share any link here. Pls PM me.

---

<div class="post-metadata">

**Author:** ![Praveen\_Yalamaddi](https://onehack.st/letter_avatar_proxy/v4/letter/p/b38774/32.png) [@Praveen\_Yalamaddi](https://onehack.st/u/Praveen_Yalamaddi)\
**Post date:** [November 19, 2019, 7:18pm UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/88 "2019-11-19T19:18:34Z")

</div>

@Aina After some days this thread will become huge and we can’t even scroll down.  
Can you please make this as page by page . So that we can navigate in between easily.

---

<div class="post-metadata">

**Author:** ![Aina](https://onehack.st/user_avatar/onehack.st/aina/32/167469_2.png) [@Aina](https://onehack.st/u/Aina)\
**Post date:** [November 22, 2019, 10:08am UTC](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680/90 "2019-11-22T10:08:21Z")

</div>

> [@Praveen\_Yalamaddi](#):
>
> @Aina After some days this thread will become huge and we can’t even scroll down.

This Theme/Script does not support Pages numbering, and when it reaches to it’s posting count I will transfer it to a new thread. And you can check/surf this thread by date numbering, Scroll-down a Bit, see at the Right side ‘‘Scroll panel’’ Move your mouse pointer on it, you will see the lite-blue scroll bar, hold and move up or down, according to dates, or just click anywhere on the scroll panel you will see how does it work. See below!

![123](https://onehack.st/uploads/default/original/3X/e/7/e7623f418ca3822630e8f667badf0838e16e9a53.png)

[Previous page](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680.md?page=3)

[Next page](https://onehack.st/t/post-only-coding-problems-solutions-here-all-coding-gurus-dig-in/60680.md?page=5)
