// Path: src/main/java/com/hackerrank/CountingValleys.java
// static int countValleys(String s) {
//     int result = 0;
//     int currentLevel = 0;
//     for (Character c : s.toCharArray()) {
//         if (c == 'U') {
//             currentLevel++;
//             if (currentLevel == 0) {
//                 result++;
//             }
//         } else {
//             currentLevel--;
//         }
//     }
//     return result;
// }


import org.junit.Test;
import static com.hackerrank.CountingValleys.countValleys;
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
package com.hackerrank;



public class CountingValleysTest {


    @Test
    public void firstTestCase() {
// Path: src/main/java/com/hackerrank/CountingValleys.java
// static int countValleys(String s) {
//     int result = 0;
//     int currentLevel = 0;
//     for (Character c : s.toCharArray()) {
//         if (c == 'U') {
//             currentLevel++;
//             if (currentLevel == 0) {
//                 result++;
//             }
//         } else {
//             currentLevel--;
//         }
//     }
//     return result;
// }


// Path: src/test/java/com/hackerrank/CountingValleysTest.java
import org.junit.Test;
import static com.hackerrank.CountingValleys.countValleys;
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;

package com.hackerrank;



public class CountingValleysTest {


    @Test
    public void firstTestCase() {
        assertThat(countValleys("UDDDUDUU")).isEqualTo(1);