Bahi 3ana problem esmo “Longest Uncomon Subsequence I “ 
→ honi fe problem 3ana zouz “Strings”  a and b 
El objective enik tlwj “longest uncommon subsequcence “ between a and b , 
Ken 7aje kema hka mch mwjoud jemla lzemik traj3 “-1” 


Q- bahi 3ana defintion honi ? chnowa blhii
→ ya sedik the definition of “uncommon  subsequence” hiya subsequence
→ fe be7tho yukon the “subsequence” mwjoud ken fe w7ed fihom 



Q- tw n7kibik tl5esli chnowa fehmt m8ir “mtghos “fe solution 
Q- ame ne7bik fe tunisi oky 

Bahi Amir, tw nhab tl5eslik el problem mch bel 7ell, ken t7eb el fekra bch t3refha men loul.

**El problem** ykoun 3andek zouz strings "a" w "b" w enti t7awel tlwj "longest uncommon subsequence" binethom. L' **uncommon subsequence** hia m3naha jemla nجم tkoun subsequence men a wla b ama mech mwjoud fi zouzhom, mech tkoun f a w fi b kif kif.

**Besh n5alleha bsita:**
1. Ki tji tlwj longest uncommon subsequence, tfakr chnowa el subsequence li mawjouda ken fi wahda mel strings w mech fel string el thanya.
2. L7alet el ekstremiya: ken el zouz strings ykounou kif kif, mta3nejch uncommon subsequence binethom. Houni trajje3 `-1`.

**Solution bch tkoun simple w mch metghish barch:** 
- Twakna: ken el string "a" w "b" mech kif kif, the longest uncommon subsequence hia string el el akber fihom, chniya el ekber? Le string li fiha a9tar toul.
- Ken a w b kif kif, el uncommon subsequence mech mawjouda w trajje3 `-1`.

El fekra ki thab tlwj l jemla el taoula eli mch mawjouda fi el deux strings kif kif.


Q- bhi awll seoul : what is the input & output format here ? 

Bahi the input bash yukon two strings 
Input  : s1 string , s2 : string 
Output : x int 

Q- oky now can you go through an example oky : 



El input a = “aba” a laer r howa “cdc” 

Bahi ntsewer ,bdwa be naive solution n5tro w7ed men string a wle b oky (ani bsh nt5tar ) the string a oky 

→ ba3idd : t7well degenerate all the subsequnce from the choising one (a ) 

“Aba” 

Here are all the subsequences of "aba":
"" (empty string)
"a"
"b"
"a"
"ab"
"aa"
"ba"
"aba"
Q- donc b3ed t7well fe kol subsequence tlwj est ce que mwjoud wle oky (ken mch wjoud ) 

Ken mwjoud donc just compare it with the reference variable oky 

Q- bahii honi el thinking process 

“Abstract “ barsh 
Mch formal  oky (using mathematical notations ) 
Naive solution not optimzied 
Q- i know this fact : 

Q- but stay with me we will go into more detail later 
Q- just from now judge only my first thinking process and give me a honest feabback oky right



N7eb n9ollek el thinking process mte3ek juste bdeytu s7i7a w mcha fel sens s7i7!

Let me give you feedback point by point:

1. **Points Positifs:**
- ✓ Bdit bel naive approach w hetha s7i7 barcha 
- ✓ Fhemt eli lazem nlawjou 3al subsequences
- ✓ Fhemt eli lazem ncompariw bin el subsequences

2. **Points à améliorer:**
- El solution mte3ek tettaleb O(2^n) complexity khater bch ta3mel generation lel subsequences lkol
- Famma des cas plus simples ma3maltelhomch attention

**Suggestion pour améliorer:**
Khalli na3tik hint: A3lech man7awlouch nfakrou fel problem mel 3aks?
Au lieu ma nlawjou 3al uncommon subsequences, na3mlou observation simple:

```text
- Ken 3ana strings différents (a ≠ b):
  -> El string el atwal bch ykoun automatically uncommon subsequence!
  Pourquoi? Khater most7il ykoun subsequence fel string lokhra ken hiya a9ser.

- Ken strings equals (a = b):
  -> Automatiquement ma3andnech uncommon subsequence, donc return -1
```

**Question:** Tnejjem tfakker 3lech el solution hedhi s7i7a? W chnowa el complexity mte3ha?


Q- klemik logics brugh 


Kef tjy tchof 3ana 2 cases : 
→ can a == b (el zouz mtb9en nafshom donc) najmo direct n9olo enou the result bsh tkon 
-1 
→ kan a!=b (el zouz moftlfin ) donc direct narjo atwlil w7da fihom 5ater impossible tal9a substring atwel men the string bedoo oky 

Max (a.length(), b.length()) → okito