A=B
评价数不足
Keep 3
   
奖励
收藏
已收藏
取消收藏
标签: level
文件大小
发表于
110.347 KB
2022 年 3 月 24 日 上午 12:53
1 项改动说明 ( 查看 )

订阅以下载
Keep 3

描述
Input: A string of "a", "b" and "c".
Output: Keep the first three letters, delete the rest.
Constraint: 3 <= Input length <= 7
2 条留言
于某人 2023 年 12 月 14 日 下午 8:55 
8 lines regular solution
I'd like to call it an exponential descending cursor



(once) = (start)xxxxxxxx

# locate position between 3 and 4
xxa = ax
xxb = bx
xxc = cx

# delete tail from 4
xa = x
xb = x
xc = x

#delete cursor
(end)x =
pinacle of positiffity 2022 年 12 月 4 日 上午 12:25 
On this problem, is there any easier solution? My solution is just brute force xd.
Its like XXXA = XXX (X can be anyletter A, B, C ) for keep first 3 letters. So I wrote all 81(3*3*3*3, 3 = A, B, C) possibilities. So if u guys find easier solution, pls share xd