Skip to content

Instantly share code, notes, and snippets.

201power

Block or report user

Report or block 201power

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View LengthOfLastWord
class Solution {
public:
int lengthOfLastWord(const char *s) {
int n=strlen(s);
int i=n-1,len=0;
if (n==0)
return 0;
while (i>=0) {
View PlusOne
class Solution {
public:
vector<int> plusOne(vector<int> &digits) {
int i,inc=0;
digits.back()=digits.back()+1;
if (digits.back() > 9){
inc=1;
digits.back()=digits.back()-10;
i=digits.size()-2;
while (i>=0) {
You can’t perform that action at this time.