Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
等しい値の部分配列は、同じ値の 1 つ以上の連続した要素を含む部分配列です。
たとえば、配列が次のようになっているとしましょう。
1,1,3
4 つの等しい値のサブ配列があります。
[1]、[1]、[3]、[1,1]
要素は、複数の部分配列の一部になる可能性があることに注意してください。
数字が一致することは知って[\d]いますが、この要件は私を失敗させています。好奇心から正規表現ソリューションを求めています。
[\d]