Help me on converting the VB scrip to Google Script

Can anyone help me to convert the following VB script to google script.

Sub ShowPass()

UserForm1.Show

End Sub

Sub ResetSIG() Dim pwd As String

‘ Turn off application events to prevent problems with the page updating Application.EnableEvents = False

‘ Get the SIG password pwd = ActiveWorkbook.Worksheets(“Drops”).Range(“A17”).Value

‘ Reset all of the tabs to their default Application.Run “Module2.ColHide”, pwd

‘ And password protect the sheets Application.Run “module2.ProtectOnly”, pwd

‘Move to the Scoping tab ActiveWorkbook.Worksheets(4).Select

‘ Turn application events back on Application.EnableEvents = True

End Sub

Sub ScopingPWProtect()

PWPass1.Show

End Sub


Sub ShowPass()

UserForm1.Show

End Sub

Sub ResetSIG() Dim pwd As String

‘ Turn off application events to prevent problems with the page updating Application.EnableEvents = False

‘ Get the SIG password pwd = ActiveWorkbook.Worksheets(“Drops”).Range(“A17”).Value

‘ Reset all of the tabs to their default Application.Run “Module2.ColHide”, pwd

‘ And password protect the sheets Application.Run “module2.ProtectOnly”, pwd

‘Move to the Scoping tab ActiveWorkbook.Worksheets(4).Select

‘ Turn application events back on Application.EnableEvents = True

End Sub

Sub ScopingPWProtect()

PWPass1.Show

End Sub


Converting a number to linked alphabet letter

I am trying to make a program that takes a number (e.g. “21213”) and prints all possible words. So “21213” can be converted to “babac”, but also to “uuc” (21-21-3), “bauc” (2-1-21-3) and so on… For now, I was only able to make it work from digit to digit:

abc = ['','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']  print('Enter a number (up to 100 digits):')  n = int(input())  N = str(n)  for i in N:     i = int(i)     print(abc[i] , end = '') 

Technique for converting recursive algorithm to DP

I’m new to Dynamic Programming and before this, I used to solve most of the problems using recursion(if needed).

But, I’m unable to convert my recursive code to DP code.

For eg, below is the pseudo-code for Finding longest common-subsequence in 2 strings :

int LCS(i,j):     if A[i]=='' or B[j]=='':         return 0;     else if(A[i]==B[j]):         return 1 + LCS(i+1,j+1)     else:         return max(LCS(i+1,j),LCS(i,j+1)) 

Now, I understand the above code and below is its DP equivalent:

//Some initializations are needed which have been skipped if(A[i]=B[j]):     LCS[i,j] = 1 + LCS[i-1,j-1] else:     LCS[i,j] = max(LCS[i+1,j],LCS[i,j+1]) 

I’m not able to figure out how did they construct its DP equivalent with the help of the recursion technique?

In the recursion technique, 1 + LCS(i+1,j+1) is written whereas, in DP 1 + LCS[i-1,j-1] has been used.

I am wondering how did they use minus in place of plus and how will I figure out myself(for other programs involving DP) that such adjustments need to be made in the code?

Best Practices – Converting code to binary

CODE:

# This code converts a string to binary # The | means bitwise or print(" ".join([bin(256 | i)[3:] ])) 

It is a one-liner, but I still need feedback on this as for whether this is the Pythonic way to convert a string of text to binary with trailing zeros such that the length of resulting binary number is 8.

Is this the most Python way to do it, or is it messy and bad?