---
# System prepended metadata

title: WDI 4.8

---

# WDI 4.8

```python=


from wdi import *

def czy_podobne(n,m):

    A = Array(10)
    B = Array(10)
    
    while n > 0:
        a = n % 10
        A[a] += 1
        n = n // 10  


    while m > 0:
        a = m % 10
        B[a] += 1
        m = m // 10


    for i in range(10):
        if A[i] != B[i]:
            return False
    return True

print(czy_podobne(123441, 311244))


#v2
from wdi.lib.wdi import *


def get_array_with_unique_numbers(source):
    list = Array(10)
    while source > 0:
        a = source % 10
        list[a] += 1
        source = source // 10
    return list


def czy_podobne(n, m):
    list_n = get_array_with_unique_numbers(n)
    list_m = get_array_with_unique_numbers(m)

    for i in range(10):
        if list_n[i] != list_m[i]:
            return False
    return True

print(czy_podobne(123441, 311244))

        
```