Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
%tail Recursion | |
-module(recursion_1_3_4). | |
-export([sum/1,fib/1,perfect/1,perfect1/1]). | |
% Try 1 | |
% | |
% Sum of numbers | |
% F(0)+F(1)+....F(N-1)+F(N) | |
sum(N) -> sum(N-1,N). |
Function generateObject() As RowCell | |
Set rfirst = Selection.Rows.Item(1) ' initialized to first row | |
Dim cell As Variant | |
Dim count As Integer | |
Dim dict As Variant | |
Set dict = CreateObject("Scripting.Dictionary") ': dict.CompareMode = vbTextCompare | |
count = 0 | |
Debug.Print "total Rows in Selection " & Selection.Rows.count | |
Dim tempRowCell As RowCell, theParentRowCell As RowCell |
-module(wf_1_peri).%week 1 final | |
-export([perimeter/1,area/1]). | |
-author("Erlang"). | |
-version(".1"). | |
% passing width and height of triangle | |
perimeter({rectangle,W,H}) -> 2*(W+H); | |
% passing Radius of Circle | |
perimeter({circle,R}) -> 2*(math:pi())*R; | |
%passing base,sides length , height |
-module(wf_1).%week 1 final | |
-export([bits/1,bitsT/1,bitsST/1]). | |
-author("Erlang"). | |
-version(".1"). | |
bits(0)->0; | |
bits(1)->1; | |
bits(N) -> bits(N div 2)+ (N rem 2). | |
%-----7 |
-module(solution). | |
-export([start/0]). | |
start() -> | |
{ok,X}=io:fread(">","~d"), | |
io:fwrite("~w~n",[X*2]). | |
Error | |
** exception error: an error occurred when evaluating an arithmetic expression | |
in function solution:start/0 (solution.erl, line 6) |
-module(solution). | |
-export([main/0]). | |
%R-Repeat,L-actual List , | |
main() -> | |
[R|L] = read_input([]), | |
foo(R,L,[]). | |
foo(_,[],NL)-> NL; | |
foo(R,[X|Xs],NL)->foo(R,Xs,NL++repeat(X,R)). |
-module(solution). | |
-export([main/0]). | |
%R-Repeat,L-actual List , | |
main() -> | |
[R|L] = read_input([]), | |
foo(R,L). | |
foo(_,[]) -> []; | |
foo(R,[X|Xs]) -> repeat(X,R), foo(R,Xs). |
% Enter your code here. Read input from STDIN. Print output to STDOUT | |
% Your class should be named solution | |
-module(solution). | |
-export([main/0]). | |
main() -> | |
{ok,[N,K]} = io:fread("","~s~d"), | |
P = ktimes(N,K,""), | |
{Num,_} = string:to_integer(P), |
-module(solution). | |
-export([main/0]). | |
main() -> | |
Arr = read_2darray(6,6,"~d"), | |
io:format("~w~n",[lists:max(groupSum(Arr,1,1,[]))]). | |
%taken in reverse order | |
read_array(0,_) -> []; |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/