✅ arrays addition
so this is a code I wrote for leet code ik code could be done better but can someone help me at the very bottom of this code error is that I simply cannot add chars from different arrays can someone help me with that
6 Replies
What exactly is the error?
Cannot apply indexing with [] to an expression of type 'char'
Yeah
digits
is a string
digits[k]
would be k
th char in that string
What would be digits[k][z]
?okay so in dictionary there is a phone and yea digits is string like "23"
and then phone[digits[k]] is the which key to acces this is a key of chars array from up in dictionary so from this you getting z th element but problem is when I try to grab those I ca do it without any strugle but problem is that I simply cannot add those two to each other
So you want
phone[digits[k]][z]
thenohh it might work I amma let you know