Skip to content

Commit

Permalink
❌ Zigzag Conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
johnazedo committed Dec 15, 2023
1 parent f16a76d commit 5dbc0d4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions leetcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ A repository to store leetcode solved problems.
| Number | Title | Tags | Status | Solution |
|--------|----------------------|-----------------------------------------------------------------------------------------|----------------|------------------------------------------------------------------------------------------------------------|
| 02 | Add Two Numbers | `Linked List` `Math` `Recursion` | :construction: | [File](https://github.com/johnazedo/interview-questions/blob/main/leetcode/medium/add_two_numbers.cpp) |
| 06 | ZigZag Conversion | | :x: | [File](https://github.com/johnazedo/interview-questions/blob/main/leetcode/medium/zigzag_conversion.cpp) |

26 changes: 26 additions & 0 deletions leetcode/medium/zigzag_conversion.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "../data_structures.h"
#include <bits/stdc++.h>

using namespace std;

/*
* Number: 06
* Difficult: Medium
* Link: https://leetcode.com/problems/zigzag-conversion/
* Tags:
*/

class Solution {
public:
string convert(string s, int numRows) {
if(s.size() <= numRows) {
return s;
}

int cols = int(ceil(s.size()/(numRows-1)));
vector<int> matrix[numRows];

int line = 0;
for(char& c: s) {}
}
};

0 comments on commit 5dbc0d4

Please sign in to comment.