From 540ee754e727cbf55f1e452cf50d5e4e1c71bbb8 Mon Sep 17 00:00:00 2001 From: AsesinoAkg Date: Sat, 22 Oct 2022 00:24:32 +0530 Subject: [PATCH 1/2] c++ solution for funny permutation --- funny | 0 funnypermutation.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 funny create mode 100644 funnypermutation.cpp diff --git a/funny b/funny new file mode 100644 index 0000000..e69de29 diff --git a/funnypermutation.cpp b/funnypermutation.cpp new file mode 100644 index 0000000..1233d23 --- /dev/null +++ b/funnypermutation.cpp @@ -0,0 +1,42 @@ +#include +using namespace std; +#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); + + +int main() +{ + + + int ttt; + cin>>ttt; + while(ttt--) + { + int n1; + cin>>n1; + if(n1==3) + cout<<"-1"< anurag; i--) + { + cout<= 1; i--) + { + cout< Date: Sat, 22 Oct 2022 00:34:29 +0530 Subject: [PATCH 2/2] c++ solution for decode ways --- decodeways.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 decodeways.cpp diff --git a/decodeways.cpp b/decodeways.cpp new file mode 100644 index 0000000..8305ecf --- /dev/null +++ b/decodeways.cpp @@ -0,0 +1,50 @@ +class Solution { +public: + int numDecodings(string s) { + /*int n = s.size(); + int n1=0,n2=1,n3,ans; + for(int i=1;i<=n;i++){ + n3=n1+n2; + n1=n2; + n2=n3; + } + cout<