---
# System prepended metadata

title: 04-28

---

# 04-28

1.
"aba" => ab
"abc" => abc
false

"aba" => ab
"aab" => ab
true

"abaa" => ab
"aab" => ab
false

function(String a, String b): Boolean
```kotlin=

if (a.length != b.length) return false

// find distinct char in string first
//Set aSet = Set(a.toCharArray())
//Set bSet = Set(b.toCharArray())

// compare each other
//return aSet.elemens == bSet.elements

val aArray = a.toCharArray()
val bArray = b.toCharArray()


```

2.

```kotlin
var isComputed = false
val isComputedStr = isComputed

fun foo(computed: Boolean) {
    isComputed = computed
    System.out.println("isComputedStr " + isComputedStr)
}

fun main() {
    foo(true)
}
```

output = true