diff --git a/solution/0000-0099/0068.Text Justification/Solution.cpp b/solution/0000-0099/0068.Text Justification/Solution.cpp new file mode 100644 index 0000000000000..be61f4e1fe641 --- /dev/null +++ b/solution/0000-0099/0068.Text Justification/Solution.cpp @@ -0,0 +1,43 @@ +class Solution { +public: +vector fullJustify(vector& words, int maxWidth) { + int n=words.size(); + vector result; + + for(int i=0;i 1 && i < n-1){ + int remaining = maxWidth - wordLen; + space = remaining / (numberofWords - 1) + 1; + extraSpace = remaining % (numberofWords-1); + } + + string line = words[begin]; + + for(int j=1;j