diff --git a/row_with_max_1.cpp b/row_with_max_1.cpp new file mode 100644 index 0000000..e9a6edd --- /dev/null +++ b/row_with_max_1.cpp @@ -0,0 +1,46 @@ +// problem link:https://practice.geeksforgeeks.org/problems/row-with-max-1s0023/1?page=2&status[]=unsolved&category[]=Arrays&category[]=Recursion&sortBy=submissions + +//{ Driver Code Starts +#include +using namespace std; + +// } Driver Code Ends +//User function template for C++ +class Solution{ +public: + int rowWithMax1s(vector > arr, int n, int m) { + + for(int i=0;i> t; + while (t--) { + int n, m; + cin >> n >> m; + vector< vector > arr(n,vector(m)); + for (int i = 0; i < n; i++) { + for (int j = 0; j < m; j++) { + cin>>arr[i][j]; + } + } + Solution ob; + auto ans = ob.rowWithMax1s(arr, n, m); + cout << ans << "\n"; + } + return 0; +} + +// } Driver Code Ends \ No newline at end of file