Solution1 stk + 从后往前,一次遍历
时间复杂度 O(n)
空间复杂度 O(n)
stk的含义:
假设 formula 是 K4(ON(SO3)2)2
,那么stk的变化是
[1] -> [1,2] -> [1,2,4]
Last updated
Was this helpful?
时间复杂度 O(n)
空间复杂度 O(n)
stk的含义:
假设 formula 是 K4(ON(SO3)2)2
,那么stk的变化是
[1] -> [1,2] -> [1,2,4]
Last updated
Was this helpful?