Home Paper Capgemini Coding Questions

Capgemini Coding Questions

by Anup Maurya
1 minutes read

11. Problem Statement : Counting Valleys, Given a sequence of up and down steps during a hike, determine the number of valleys traversed.

Sample Test Case
Input:

8
UDDDUDUU
Output: 1
Explanation: A valley is a sequence of consecutive steps below sea level. The example describes a single valley.

12. Problem Statement : Matrix Identity Check, Write a program to check if two given matrices are identical.

Sample Test Case
Input:

Matrix A: [[1,1,1,1], [2,2,2,2], [3,3,3,3], [4,4,4,4]]
Matrix B: [[1,1,1,1], [2,2,2,2], [3,3,3,3], [4,4,4,4]]
Output: Matrices are identical
Explanation: The program checks each corresponding element in both matrices for equality.

related posts

Leave a Comment

Enable Notifications OK No thanks