Skip to content

Instantly share code, notes, and snippets.

@ankita199
ankita199 / solution-01.rb
Created October 9, 2020 02:55
Reverse Given Input and fibonacci series
def get_reverse(str)
str.reverse
end
str = "hello"
puts get_reverse(str)
@ankita199
ankita199 / find_next_largest_number.rb
Last active July 30, 2019 08:27
Implement a ruby method to find the next largest number with the same digits of the input number. Ex: 38276 would return 38627.
# Given a number as a char array number[], this function finds the next greater number.It modifies the same array to store the result
def findNextLargestNumber(array,n)
begin
# 1) Start from the right most digit and find the first digit that is smaller than the digit next to it.
i = n -1
loop do
break if array[i] > array[i - 1]
i = i - 1
end
class NotificationsController < ApplicationController
protect_from_forgery :except => :paypal_ipn
def create
params.permit! # Permit all Paypal input params
#query = params
puts "in method*************************************"
#query[:cmd] = "_notify-validate"
#if params[:txn_type] == 'subscr_cancel'
# user_subscription = Subscription.find_by(paypal_customer_token: params[:payer_id])