This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_reverse(str) | |
str.reverse | |
end | |
str = "hello" | |
puts get_reverse(str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) |