You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2><ahref="https://leetcode.com/problems/alternating-digit-sum/">2544. Alternating Digit Sum</a></h2><h3>Easy</h3><hr><p>You are given a positive integer <code>n</code>. Each digit of <code>n</code> has a sign according to the following rules:</p>
2
+
3
+
<ul>
4
+
<li>The <strong>most significant digit</strong> is assigned a <strong>positive</strong> sign.</li>
5
+
<li>Each other digit has an opposite sign to its adjacent digits.</li>
6
+
</ul>
7
+
8
+
<p>Return <em>the sum of all digits with their corresponding sign</em>.</p>
0 commit comments