text:
root of root of root of root
This idea came to me when I saw my little brother playing with my calculator :D
The task
Taking a integer as an input, print that many graphical square roots under each other, like this:
n = 1

  ___
\/ 1

n = 3
    _______
   / _____
  / / ___
\/\/\/ 3

n = 5

      ___________
     / _________
    / / _______
   / / / _____
  / / / / ___
\/\/\/\/\/ 5

n = 10

           ______________________
          / ____________________
         / / __________________
        / / / ________________
       / / / / ______________
      / / / / / ____________
     / / / / / / __________
    / / / / / / / ________
   / / / / / / / / ______
  / / / / / / / / / ____
\/\/\/\/\/\/\/\/\/\/ 10

Each root consists of 4 parts, which I'm going to very scientifically name:
(s is the root size on the stack of roots, n is the input number, x is the number of digits)

The "tail", which is a single \
The "wall", which consists of / * s
The "roof", which consists of  _ * 2 * s + x
And the number n under the smallest root, placed in the centre (leaving one empty space under the last _ in the smallest root)

Input
You must take input of the number n, no hardcoding the n
Output
The ascii roots your program made
This is a code-golf challenge, so lowest byte count for each language wins!

Will the number exceed the digit 9?

@Λ̸̸ good catch, will edit the rules. Yes, it can exceed the digit 9, updating the rules to clarify what to do

Related (the same idea, but different art)

Why does the input have to be from STDIN and out to STDOUT? That seems like an unnecessarily arbitrary restriction.

I'd be impressed by code that could evaluate such expressions... and not by assuming the number under the radicals equals the number of radicals.

@RossPresser good idea, maybe will post a challenge like that :)

Also related, but only one square root

@RossPresser Less interesting than you might think: with input s as a string, l = s.splitlines()[-1]; print(int(l[l.index(' '):]) ** (1 / l.count('/'))).

If the number can exceed 9, what is the maximum input?

What do we do if n is negative?

@Xcali you can assume that n is always positive

This challenge was posted on May 9, and then the “stdin/stdout” I/O rule was lifted on July 28, meaning many of these answers could now save bytes and are hard to compare/compete with. There's a cautionary tale here: if you do decide to change the rules, please do so within about a day of the challenge being posted ^^;

05AB1E, 30 bytes
-4 bytes thanks to Kevin Cruijssen.
Lε-„/ ×'_y·¹g+×«y>ú}R„\/¹×¹‚ª»

Try it online!

ð«¹« can be ¹‚ for -2 (» will join all inner lists by spaces before joining by newlines). And another -2 by changing >ð×„/ ¹y-×'_y·¹g+×J to -„/ ×'_y·¹g+×«y>ú (the ¹y- has been golfed to - for -2, and the >ð× has been replaced with a trailing y>ú for the same byte-count). So combined it's 30 bytes.

29 bytes

Python 2, 104 94 89 81 79 bytes
s=n=input()
while s:print' '*s,'/ '*(n-s)+'_'*(2*s+len(`n`));s-=1
print'\/'*n,n

Try it online!
Edit 1: Forgot I switched to python 2 lol
Edit 2: Thanks @ElPedro for the idea of switching to while loop!
Edit 3: Thanks @SurculoseSputum for saving 8 bytes!
Edit 4: Thanks @xnor for saving 2 bytes!

@Λ̸̸ XD my answer could probably be much shorter

You posted a minute before I did and mine is so similar that I'll delete and try to golf yours instead :)

@ElPedro yep, I saw your answer and remembered that i switched to python 2 for all of the savings)

92 Try it online!

@ElPedro 89 bytes :)

83 bytes

@SurculoseSputum what exactly does the -~ do? I'm failing at finding it in the documentation xd

@Dion -~ bitwise negates (evaluated -1-x), then negates. This basically increments the number. You can take a look at this post.

88 Try it online! ;)

@ElPedro Surculose Sputum already outgolfed you. ;)

81 bytes by taking advantage of the fact that comma in print gives an extra space.

@ElPedro that doesn't work for 3 digits input

@SurculoseSputum Good point

I made something 82 bytes, but it uses exec instead of while, maybe it can be shortened Try it online!

No need for the backticks around the n you print at the end

@xnor oh wow, nice catch xd

JavaScript (ES6),  104 102  99 bytes
A recursive function starting with the last line and using regular expressions to update each line above.
f=(n,s='\\/'.repeat(n)+(e=' ')+n)=>~n?f(n-1,e+s.replace(/\\/g,e).replace(/.(?!.*\/)/g,'_'))+`
`+s:e

Try it online!
How?
Initialization
We generate the bottom line with:
s = '\\/'.repeat(n) + (e = ' ') + n

For instance, this gives "\/\/\/\/ 4" for \$n=4\$.
Recursion
We get rid of the backslashes with:
s.replace(/\\/g, e)

We create the 'roof' or increase its size with:
.replace(/.(?!.*\/)/g, '_')

which means: replace with an underscore each character that doesn't have any slash on its right.
This leads to:
 _________
 / _______
 / / _____
 / / / ___
\/\/\/\/ 4

And with a leading space inserted at each iteration:
     _________
    / _______
   / / _____
  / / / ___
\/\/\/\/ 4

Erlang (escript), 188 bytes
f(0,N)->string:copies("\\/",N)++" "++integer_to_list(N);f(X,N)->string:copies(" ",X+1)++string:copies("/ ",N-X)++string:copies("_",2*X+floor(math:log10(N)+1))++"
"++f(X-1,N).
f(N)->f(N,N).

Try it online!
Explanation
f(N)->f(N,N).   % Assign the counter to the input.
f(X,N)->        % While the counter isn't 0:
string:copies(" ",X+1)
                %     Repeat the space counter + 1 times

++string:copies("/ ",N-X)
                %     Repeat "/ " input - counter times

++string:copies("_",
                %     Repeat the "_" that many times:

2*X             %     The counter doubled
+floor(math:log10(N)+1)
                %     Plus the length of the digit(s) of the input
++"
"               %     Join the above, and append a newline
++f(X-1,N).     %     Decrement the counter by 1

f(0,N)->        % If the counter turns into 0:
string:copies("\\/",N)
                %     Repeat "\/" input times

++" "           %     Append a space
++integer_to_list(N);
                %     Append the number converted into a string
```

Mathematica (Notebook) 30 bytes
Only in Spirit ;-)
Nest[Defer@√#&,#,#]&@Input[]

produces the nested radicals

in the spirit but not the letter of the problem.
Explanation
Input[]              //take input

Nest[f,expr,n]       //apply f to expr n times i.e. f[f[f[f[f....[expr]]..]] with n fs
Nest[f,#,#]&         //define a lambda that applies f to arg #, # times
Nest[f,#,#]&@Input[] //apply the lambda Nest[f,#,#]& to the value of Input[]

√#&                  //define a lambda that puts arg # inside √
Defer@√#&            //define a lambda that puts arg # inside √ buts keeps the mathematical square root unevaluated

Nest[Defer@√#&,#,#]&@Input[]
                     //apply the lambda Defer@√#& to Input, Input no of times

Pyth, 34 bytes
VQj*N"/ ",*hJ-QNd*+l`QyJ\_;jd,*"\/

Try it online!
VQ

Loop the variable N over 0 to Q (the input) minus 1
j*N"/ "

Join the following using N instances of "/ ":
,

The two element list of...
*hJ-QNd

... {Q - N + 1} space characters (d is the space character in Pyth). Store the value of Q minus N in the variable J so we can use it later.
*+l`QyJ\_

... {J times 2, plus the number of digits of Q} instances of the string "_"
;

End of loop
jd,*"\/

Join the following using a space:

Q instances of the string "\/"
Q casted to a string

Conveniently, the string literal is implicitly closed, and the two Qs are implicitly appended to the end of the program.

PowerShell, 88 84 bytes
param($n)1..$n|%{' '*($m=$n- --$_)+' /'*$_+' '+'_'*(2*$m+"$n".length)}
'\/'*$n+" $n"

Try it online!

Charcoal, 30 bytes
ＮηＧ↙η←⁺²Ｌθ↖η_Ｍη↘Ｐθ←←Ｆη«Ｐ↗⊕ι←/\

Try it online! Link is to verbose version of code. Explanation:
Ｎη

Input n as a number.
Ｇ↙η←⁺²Ｌθ↖η_

Print the "roof", ensuring that it is long enough to overhang n.
Ｍη↘Ｐθ←←

Print n as a string in the appropriate place.
Ｆη«

Loop n times.
Ｐ↗⊕ι

Print the next diagonal line of the "wall".
←/\

Print the next part of the "tail".

MATL, 43 bytes
:P"@QZ"47Oh1X@qX"95GVn@E+Y"hh]'\/'1GX"0GVhh

Try it online!
First time I have used X", Y", Z" in the same answer!

Jelly, 36 bytes
DLṭ1j+1,-,2×Ɱ$“ “/ “_”ẋ"ⱮṚṄ€ȧ⁾\/ẋ,⁸K

A full program which prints the result.
Try it online!
How?
DLṭ1j+1,-,2×Ɱ$“ “/ “_”ẋ"ⱮṚṄ€ȧ⁾\/ẋ,⁸K - Main Link: integer, n
D                                    - digits (n)
 L                                   - length
  ṭ1                                 - tack to one
    j                                - join with (n)
             $                       - last two links as a monad - f(n):
      1,-,2                          -   [1,-1,2]
            Ɱ                        -   map across [1..n] with:
           ×                         -     multiplication
     +                               - add (left to each of right, vectorised)
              “ “/ “_”               - [' ', '/ ', '_']
                        Ɱ            - map across (the list of list of numbers) with:
                       "             -   zipped:
                      ẋ              -     repetition
                         Ṛ           - reverse
                          Ṅ€         - print each with trailing newlines
                            ȧ        - logical AND (with n) -> n
                             ⁾\/     - ['\', '/']
                                ẋ    - repeat (n times)
                                 ,⁸  - pair with n
                                   K - join with a space
                                     - implicit print

C# (Visual C# Interactive Compiler), 217 154 bytes
n=>Join("",Range(0,n).Select(i=>new S(' ',n-i+1)+new S('/',i*2)+new S('_',(n-i)*2-~(n+"").Length)+'\n').Concat(Repeat("\\/",n))).Replace("//", "/ ")+" "+n

Try it online!
Edit: Removed 19 bytes thanks to @KevinCruijssen, and used the header better(?)

Hi, welcome to CGCC! Unless you use it as a recursive function, you don't need to count the Func<int,string>f= and trailing ; in your byte-count. You can move those to your head & footer of your TIO-link. :) Also, (n+i-n)*2 is basically i*2. And n/10 is incorrect I'm afraid for $n\geq100$. This should be (n+"").Length() instead. In that case, you can also golf the (n-i)*2+1+(n+"").Length() to (n-i)*2-~(n+"").Length() (relevant tip). In total, it'll become 198 bytes. Enjoy your stay! :)

@KevinCruijssen Thanks for the comment! And the tips. I saw others but their printing code in the footer, but I didn't know how much, or what, was okay to put in the header/footer.
I added your suggestions, and some usings to my answer, do you think it's still acceptable?

MathGolf, 32 bytes
{kî-⌠ *_£(∞k£+'_*û/ ï*\n}û\/k* k

Try it online.
Explanation:
{             # Loop the (implicit) input amount of times:
 k            #  Push the input-integer
  î-          #  Subtract the 1-based loop-index
    ⌠         #  + 2
      *       #  And repeat that many spaces
 _            #  Duplicate this string
  £           #  Pop and push its length
   (          #  + 1
    ∞         #  * 2
     k        #  Push the input-integer again
      £       #  Pop and push its length
       +      #  Add those two integers together
        '_*  '#  And repeat that many "_"
 û/           #  Push the 2-char string "/ "
    ï*        #  And repeat it the 0-based loop-index amount of times
 \            #  Then swap the top two strings on the stack
 n            #  And push a newline character
}û\/k*        # After the loop: repeat 2-char string "\/" the input amount of times
              # Push a space
 k            # And push the input-integer
              # (after which the stack is joined together and output implicitly)

Wolfram Mathematica 120 bytes
a=StringRepeat;b=Print;Input[];
b[a[" ",#+1],a["/ ",%-#],a["_",2#+IntegerLength[%]]]&/@Range[%,1,-1];b[a["\/",%]," ",%];

Explanation
StringRepeat[str,n]
                      //creates a string with str repeated n times

a=StringRepeat
                      //alias for StringRepeat

Print[expr1,expr2,...]
                      //prints expr1, expr2,... on a newline without separation

b=Print
                      //alias for Print

Input[]
                      //gets user input,

;
                      //Hide implicit output

%
                      //last output

IntegerLength[n]
                      //no of digits in n in base 10

a[" ",#+1]
                     //Make a lamba StringRepeat with arg #, that prints " ",#+1 times

b[a[" ",#+1],a["/ ",%-#],a["_",2#+IntegerLength[%]]]&

                     //Make a lambda with arg # that
                     //prints the appropriate "     /_________"
                     //depending on #

b[....]&/@Range[%,1,-1];
                     //map the lambda b[....] over {%,%-1,%-2,...,1}

b[a["\/",%]," ",%];
                     //print the last row "\/\/\/...\/ "

Link to notebook

Haskell, 129 bytes
x%s=[1..x]>>s
0#b=b%"\\/"++' ':show b
x#b=(x+1)%" "++(b-x)%"/ "++(show b>>"_")++x%"__"++'\n':(x-1)#b
f x=x#x
main=interact$f.read

Try it online!
Ties the existing 129 byte answer but is compliant with the challenge by performing full IO.

Retina 0.8.2, 77 bytes
^
$.'$*_=$'$*/¶$'$*V
/
=$.%'$*=¶  $.%'$* $`
=
__
(_+)(/+)
$2$1
/
/
V
\/
1A`

Try it online! Explanation:
^
$.'$*_=$'$*/¶$'$*V

Insert some working elements: enough _s to cover the input, a / for each input, then on the next line, a V for each input (representing \/) and a space.
/
=$.%'$*=¶  $.%'$* $`

Now expand the /s into a bottom right triangle, and also add extra _s to overhang on both sides on each line.
=
__

Expand the =s which were placeholders for two _s.
(_+)(/+)
$2$1

Move the input cover next to the rest of the overhang.
/
/

Space the /s apart.
V
\/

Expand the Vs on the last line.
1A`

Delete some left-overs.

Haskell, 129 bytes
r=replicate
c=(concat.).r
f n|s<-show n=unlines$map(\o->r(n-o+1)' '++c o"/ "++r(2*(n-o)+length s)'_')[0..n-1]++[c n"\\/"++" "++s]

Try it online!

This challenge has a restricted IO scheme, which does not permit functions.  In order for this to be a valid answer you are expected to write a main declaration.

Python 3, 100, 99 bytes
n=int(input())
for i in range(n):print(" "*(n+~i)," /"*i,"_"*(2*n-2*i+len(str(n))))
print("\/"*n,n)

Try it online!
thnx to @KevinCruijssen for -1

n-1-i can be n+~i for -1 (relevant tip).

Java 11, 137 124 bytes
n->{String l="\\/".repeat(n)+" "+n,r=l;for(;n-->0;r=l+"\n"+r)l=" "+l.replace('\\',' ').replaceAll(".(?!.*/)","_");return r;}

-13 bytes by porting @Arnauld's JavaScript answer, so make sure to upvote him!
Try it online.
Explanation:
n->{                       // Method with integer parameter and String return-type
  String l=                //  Temp-String `l` for the current line, starting at:
           "\\/".repeat(n) //   The input amount of "\/"
           +" "+n,         //   appended with a space and the input
         r=l;              //  Result-String, starting at this (last) line
  for(;n-->0               //  Loop `n` amount of times:
      ;                    //    After every iteration:
       r=l+"\n"+r)         //     Prepend the new `l` with newline to the result-String
    l=                     //   Change `l` to the new line:
      " "                  //    A space
      +l                   //    appended with the current line, with the replacements:
        .replace('\\',' ') //     All '\' replaced with spaces
        .replaceAll(".(?!.*/)","_");
                           //     And all characters NOT followed by a '/' with a "_"
  return r;}               //  And return the result-String after the loop

Julia, 107 bytes
n=parse(Int,readline())
println.([[" "^(s+1)*"/ "^(n-s)*"_"^(2s+length("$n")) for s=n:-1:1];"\\/"^n*" $n"])

Try it online!
Breakdown
n = parse(Int, readline())
println.([ # broadcasting with `.` applies `println` to each element of vector
    [
        " "^(s + 1)*"/ "^(n - s)*"_"^(2s + length("$n"))
        for s ∈ n:-1:1 # array comprehension
    ];   # semicolon enables blockmatrix-style array syntax...
         # ...which unpacks elements in array above into elements of vector
    "\\/"^n*" $n" # last element of vector
])

Perl 5 -ap, 86 bytes
$\=$/.'\\/'x$_." $_";$_=$"x($_+1).'_'x(2*$_+y///c);for$a(1.."@F"-1){say;s, /| __,/ ,g}

Try it online!

Nice answer, pretty short too considering the length of a lot of the other answers, you can save a little bit more with some re-ordering and a couple of other tweaks though!: Try it online!

CJam, 46 bytes
li:A:B;{A)S*"/ "BA-*'_2A*Bs,+*NA(:A}g"\\/"B*SB

Try it online!
Port of my Python answer
Explanation:
li            take input as integer
:A:B;         assign that to the variables A and B
{             start of while A loop
A)S*          push A-1 spaces
"/ "BA-*      push B-A strings of "/ "
'_2A*Bs,+*    push 2A + the number of digits _
N             push a newline
A(:A          decrement A
}g            end of while loop
"\\/"B*       push B \/
SB            push B after a space

Haskell, 122 bytes
x%y=[1..x]>>y
f x|n<-read x=unlines[(n+1-i)%" "++i%"/ "++(n-i)%"__"++(x>>"_")|i<-[0..n-1]]++n%"\\/"++' ':x
main=interact f

Try it online!
I've deliberately constrained myself to standard I/O. See my comments on the question.

Vyxal So, 30 bytes
ɾṘ›?ʀṪ‛/ *꘍?ɾd?L+\_*Ṙ+⁋,‛\/*$"

Try it Online!
This code's sorta backwards to reduce stack operations.
           ?ɾd                 # (1...input) * 2
              ?L+              # + log_10(input)
                 \_*           # That many underscores for each
                    Ṙ+         # Reverse that, and append to...
ɾṘ›                            # (2...input+1) reversed
          ꘍                    # For each, that many spaces appended to each of...
   ?ʀṪ                         # 0...input-2
      ‛/ *                     # For each, that many copies of "/ "

                      ⁋,       # Print that, joined on newlines
                        ‛\/*   # Input * "\/"
                            $" # Paired with input
                               # (So flags) print that joined by a space

Perl 5, 96 bytes
sub f{$n=pop;join"\n",(map' 'x($x=1+$n-$_).'/ 'x$_.'_'x($x*2-2+length$n),0..$n-1),'\/'x$n." $n"}

Try it online!

PHP, 121 bytes
for($x=($i=$j=$argn)/10+1,$f=str_repeat;$i;$c.="/ ")printf("%{$i}s $c%s\n"," ",$f("_",2*$i--+$x));echo$f("\\/",$j)." $j";

Try it online!
This is not that great maybe, but I came with this.

Pyth, 54 44 bytes
VQ+d++*-QNd*"/ "N*+*2-QNl+""Q"_";++*"\/"hNdQ

Try it online!
edit 1: Thanks @mathjunkie for saving 10 bytes!

A few tips:  FNrZ can be replaced by V. Each of the space literals (" ") can be replaced by d. Anywhere that you use +1 you can use h instead

Pip, 38 bytes
Fi,aP[sYsXa-i"/ "Xi'_Ma.y.y]"\/"Xa.s.a

Try it online!
Explanation
This is one of those very rare occasions in Pip when a for loop seems to be the shortest solution.
Fi,aP[sYsXa-i"/ "Xi'_Ma.y.y]"\/"Xa.s.a
                                        s is space; a is 1st command-line arg (implicit)
Fi,a                                    For i in range(a):
    P                                    Print, with a newline
     [                     ]             the contents of this list, implicitly concatenated:
      s                                   A space
        sXa-i                             Space, repeated (a-i) times
       Y                                   also, yank that string into the y variable
             "/ "Xi                       "/ ", repeated (i) times
                      a.y.y               Concatenate a with y twice
                   '_M                     and replace each character with an underscore,
                                           giving a string of len(a) + 2 * (a-i) underscores
                            "\/"Xa      "\/", repeated (a) times
                                  .s    concatenated to space
                                    .a  concatenated to a
                                        Autoprint (implicit)

Scala, 91 bytes
n=>print(n.to(1,-1).map{i=>" "*(i+1)+"/ "*(n-i)+"_"*(2*i+1)}:+("\\/"*n+" "+n)mkString "\n")

Try it online!

MAWP, 138 bytes
%@![1A~!~]%![!!!1M[84W;1A]%\A[95W2M;84W;1A]%2W1M3A{3M[29W1M5W;1A]25W;%1A}]~!!0/[25WP~1M~]%\1A3M[29W1M5W;1A]25W;%[99W25WM1M;95W2M;1A]%84W;:

Works as expected for single digit numbers, but beyond that, the last root will be longer than the others.
Try it!

Husk, 46 bytes
`:§+*"¦/"o:' s¹z+mR' ṫ¹m§+*" /"(:' R'_+L¹D≠¹)ŀ

Try it online!

Java (JDK), 139 171 bytes
String g(int k){return g(0,k);}String g(int i,int n){return i<n?" ".repeat(n-i+1)+"/ ".repeat(i)+"_".repeat((n-i)*2+(""+n).length())+"\n"+g(++i,n):"\\/".repeat(n)+" "+n;}

Try it online!
No for loop, recursion is used. Therefor I had to define the function as a method because I couldn't find a way to define it as a BiFunction lambda expression and call it recursively. The method has 2 inputs: zero as first argument, the integer input parameter as second. And thus added an overloaded method with only one parameter.
Explained
String g(int i,int n) {                          // i is current index (start with 0), n is the input parameter value
  return i<n?                                    // are we not yet at the end?
         " ".repeat(n-i+1)                       // add spaces
          +"/ ".repeat(i)                        // add i times '/ '
          +"_".repeat((n-i)*2+(""+n).length())   // add underscores, including extra for the length of the input value
          +"\n"                                  // add CRLF
          +g(++i,n)                              // recursive call with i+1
         :
         "\\/".repeat(n)+" "+n                   // at last i=n, add \/ + input parameter value
;}                                               // what goes open, must be closed

Called as
System.out.println(g(10));

139 -> 171 : to make it acceptable with only 1 input parameter (@Razetime)

I think you should overload the function to accept a single parameter like this: Try it online! That way it'd be valid.

@Razetime, I'm afraid you're right :(. Added your suggestion to the answer. Thanks for the remark.

Joys of golfing in a verbose language. You should check out this thread for some shortening methods.


text:
Solve a Picross Row
Introduction
A picross, also known as a nonogram, is a logic puzzle in which the player is given an initially blank grid and must shade in particular boxes on the grid to reveal an image. Numbers are written on the top and the left side, and they explain the image's coloration: each number corresponds to an unbroken line of shaded-in boxes in its row or column. Consider any individual row or column from this completed puzzle to see this correspondence:

Not shown in the image is the fact that one can write an "X" to indicate that a box is known not to be shaded in. Partially solving a row or column by shading in and crossing out boxes provides necessary information for the rest of the puzzle, as rows and columns usually cannot be completely solved on their own (for instance, in the image, this is only possible in the first row).
The Challenge
To take the hints for a given row along with the state of each box in the row as inputs, and output the row solved to the fullest extent possible.

Examples
In these examples, let 0 represent a box with an "X", 1 a shaded-in box, and 2 an unknown or unknowable (that is, blank) box.

This row would be input as
[1,3,7,1], [2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]

and the program should output the following:
[2,2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2,2,2]

This output corresponds to this row, and no more information can be found:

The boxes marked 1 are always that way, no matter the arrangement of the shading. Essentially, if a box always has the same state, it must assume that state, lest the shading contradicts what is known. If there is not a unanimous agreement, then the box is unknowable and is marked 2.

Input: [1,3,7,1], [2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2]
Output:           [2,2,2,2,2,2,0,2,2,2,2,1,1,1,2,2,2,2,2,2]

Input: [6], [2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2]
Output:     [0,0,0,0,0,0,0,2,2,2,2,2,1,2,2,2,2,2,0,0,0,0,0,0,0]

If a 6-wide shading were to begin in any of the first 7 boxes, the row would have to have [6,1] or [7] as its hints, and so none of the first 7 boxes can be filled in. The same is true for the right side.

Input: [3], [2,0,2,2,2,2,0,2]
Output:     [0,0,2,1,1,2,0,0]

Because a 3-wide shading can only fit in the 4-wide gap in the middle, the 1-wide gaps on the edges can be turned into 0s

Rules

Any three distinct symbols may be used in the place of 0, 1 and 2 so long as it is indicated which symbol corresponds to which state

Assume the input hints and row never form an impossible combination

This is code-golf, so the shortest program in bytes in each language wins

I'd suggest a slight change: the shortest program in bytes in each language wins. That way people don't get discouraged by an 8-byte answer in a golfing language they can't read.

Can the input/output be 3 bit masks indicating the position of 0, 1 and 2? For example 0112 becomes 1000, 0110, 0001

certainly @SurculoseSputum

Python 2, 127 124 123 bytes
-1 byte thanks to @ovs !
l,a,b,c=input()
x=y=i=a|b|c
while i:
 if[len(z)for z in bin(i)[2:].split("0")if z]==l>i&a<1>~i&b:x&=~i;y&=i
 i-=1
print x,y

Try it online! or Verify test cases
(Timed-out in TIO for the 2nd test case, but I have verified the program on my PC.)
Reads from STDIN the list of streaks l, and 3 numbers a, b, c representing bit-masks of empty cells, filled cells, and unknown cells.
Prints to STDOUT 2 numbers, representing the bit-masks of guaranteed empty cells and guaranteed filled cells.

Charcoal, 129 bytes
ＳθＷΣθ«⊞υιＳθ»≔Ｅυ⁰ζ⊞ζ⁻Ｌθ⁺Συ⊖Ｌυ≔⟦⭆ζ⁺×:⊕ι×#§υκ⟧εＷ⌊ΦＬζ∧κ§ζκ«ＵＭζ⎇‹λι∧⁼λ⊖ι⊕Σ…ζι⁻κ⁼λι⊞ε⭆ζ⁺×:⊕κ×#§υλ»≔Φε⬤θ№⁺-§ι⊕μλε⭆θ§-#:⁻⬤ε⁼§λ⊕κ#⬤ε⁼§λ⊕κ:

Try it online! Link is to verbose version of code. I've used - for unknown, : for empty and # for shaded, but of course these could readily be changed to other characters. Explanation:
ＳθＷΣθ«⊞υιＳθ»

Input the runs and the known state.
≔Ｅυ⁰ζ⊞ζ⁻Ｌθ⁺Συ⊖Ｌυ

Start by putting all the spare space after the last run.
≔⟦⭆ζ⁺×:⊕ι×#§υκ⟧ε

Create a list whose entry is an image of that spacing, but with an extra space at the start and junk after the end.
Ｗ⌊ΦＬζ∧κ§ζκ«

Repeat while runs can be moved.
ＵＭζ⎇‹λι∧⁼λ⊖ι⊕Σ…ζι⁻κ⁼λι

Calculate the next permutation of runs. This is achieved by moving left the first run that can still be moved left, and then moving all the previous runs to its immediate left.
⊞ε⭆ζ⁺×:⊕κ×#§υλ»

Push an image of the new spacing to the list.
≔Φε⬤θ№⁺-§ι⊕μλε

Delete the runs that don't match the original input.
⭆θ§-#:⁻⬤ε⁼§λ⊕κ#⬤ε⁼§λ⊕κ:

Output the knowable state.

Wolfram Language, 155 bytes
Union@*List~MapThread~Cases[IntegerDigits[i,2,l]~Table~{i,0,2^(l=Length@#)}~Cases~#,
{0...,Splice@Riffle[1~Repeated~{#}&/@#2,0..],0...}]/.{0,1}->_/.{a_}->a&

(newline added for "readability")
Try it online!
Note: Since the version that tio.run has is apparently not the latest version (12.1), and Splice was added in it, I have added an equivalent definition.
Uses _ rather than 2 in the input to leverage built-in pattern-matching capabilities.
The method this answer uses is not very efficient, so don't try any massive inputs.
Program description:

Generates all sequences of 0 and 1 of the proper length: IntegerDigits[i,2,l]~Table~{i,0,2^(l=Length@#)}
Filter to those that match the already solved cells: ~Cases~# (super easy because I specify the input to work as a pattern)
Filter to those that match the row description: Cases[  ,{0...,Splice@Riffle[1~Repeated~{#}&/@#2,0..],0...}]
Get list of options for each position: Union@*List~MapThread~
Convert back to input form: /.{0,1}->_/.{a_}->a

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Parse ascii art math!
The task
Given a multiline string with ascii art operators and numbers, parse the expression!
Possible symbols
Numbers: (3x4)
 /
/|
 |
---

___
 _|
|
---

___
 _|
  |
---

| |
|_|
  |
  |

___
|_
  |
---

___
|_
| |
---

___
  /
 /
|

___
|_|
| |
---

___
|_|
  |
---

___
| |
| |
---

Operators: (3x3)
 |
-+-
 |

---

\ /
 x
/ \

 .
---
 .

Braces: (1x4)
/
|
|
\

\
|
|
/

Input
A multiline string with ascii art operators and numbers. Examples in the test cases.
Output
The string of the parsed expression.
Test cases
Input:

/ ___     ___ \     ___
|  _|  |    / |  .   _|
| |   -+-  /  | ---   |
\ ---  |  |   /  .  ---

Output: (2+7)/3
Input:
___      /      ___
|_|     /|  \ / |_
  | ---  |   x    |
---     --- / \ ---

Output: 9-1*5
Rules

Numbers will always be single-digit
Since operators are one symbol shorter than numbers, they are placed one symbol lower than numbers, leaving whitespace on top.
All symbols have a column of whitespace between them
This is a code-golf challenge, so lowest byte count wins!

May we assume the lines of text are all of the same length (filled with spaces on the right when necessary to do so)?

@JonathanAllan yes

Would have been funnier to ouput the result :)

@OliverGrégoire that was the og post, but it was quickly agreed that evaluating the expression was a useless part

@Dion But printing calculated result as ASCII would make evaluation less useless I think?

I nominate this for "ugliest ASCII art challenge"!

@anatolyg it's funny cause I spent way too much time on them :D

APL (Dyalog Unicode), 46 44 bytes
'/(80-)63+92145*7'[16|43|25⊥¨(×⊆⊢)2⊥' .\'⍳⎕]

Try it online!
⎕ evaluated input, must be a character matrix
' .\'⍳ replace spaces with 0, .s with 1, \s with 2, and everything else with 3
2⊥ base-2 decode the columns
(×⊆⊢) split on zeroes
25⊥¨ base-25 decode each group
16|43| mod 43, mod 16
'/(80-)63+92145*7'[ ] use as indices in the given string

Python 2, 154 139 bytes
s=zip(*input().split('\n'))
i=0
while s[i:]:d=3**(max((s+[' '])[i+1])>' ')+i;print'+/5(_41_7802*6__-9)3'[hash(tuple(s[i:d]))*3%67%21];i=1+d

Try it online!

APL (Dyalog Unicode), 69 61 bytes
Anonymous tacit prefix function. Requires ⎕IO←0.
{('+-*/()',⎕D)['∆JV⍺TgucKmre3Ha'⍳⎕AV[94|2⊥¨,⌿⍵⊆⍨∨⌿32≠⍵]]}⎕UCS

Try it online!
⎕UCS convert characters to code points
{…} "dfn"; argument is ⍵
 ('+-*/()',⎕D) the involved symbols followed by the Digits
 […] index into that using the following indices:
  '∆JV⍺TgucKmre3Ha'⍳ indices in this string (missing elements get index=length) of
  ⎕AV[…] index into the Atomic Vector (the character set) using the following:
   94| the division remainder when divided by 94 of
   2⊥¨ the base-2 evaluation of each of
   ,⌿ the vertically joined and flattened
   ⍵⊆⍨ segments of the argument, as indicated by trues in
   ∨⌿ the vertical OR-reduction of
   32≠⍵ the Boolean mask indicating where the argument is different from 32 (space)

JavaScript (Node.js), 152 bytes
f=(s,i=0,a=s.split`
`,c=a[n=0][i],x=1)=>c?"*3-425()6+9/7081"[c=='/'?6:c=='\\'?7:[x=3,4,5,6,9].map(c=>n+=Buffer(a[c/3|0])[i+c%3]*c)|n%47%16]+f(s,i-~x):''

Try it online!

Charcoal, 67 bytes
⭆⪪⭆θ§αＩ⭆⟦θηζε⟧÷⊖℅§λκ³²A℅⁺⁴⁰÷⌕”$⌈O⁴εΦa↙M∕³↧ＦωＧ↙σ⎇C(｜？⊞¦﹪ω←2Ｉ0C⁻sⅉ”ι³

Try it online! Link is to verbose version of code. Assumes 4 input strings of equal length (space padded if necessary). Explanation:
   θ                                First input
  ⭆                                 Map over characters and join
        ⟦θηζε⟧                      All four inputs as a list
       ⭆                            Map over strings
                  λ                 Inner string
                 §                  Indexed by
                   κ                Outer index
                ℅                   Take the ASCII code
               ⊖                    Decrement
              ÷     ³²              Integer divide by literal `32`
      Ｉ                             Cast to integer
    §α                              Index into uppercase alphabet
 ⪪                    A             Split on literal `A`
⭆                                   Map over substrings
                            ⌕...ι   Find their indices in compressed data
                           ÷     ³  Integer divide by 3
                        ⁺⁴⁰         Plus literal `40`
                       ℅            Convert to ASCII
                                    Implicitly print

The compressed data represents the literal string GAARAATEYKBKAAAKKKAAAKHKRZRXFBDRNZRRYSFNRDRRDBIURRRNRR which contains the pattens that result from the calculation, padded with As to place them at the appropriate offset to generate the desired ASCII character.

Jelly, 36 bytes
ỴZ⁶=ẠƊ€œp$“¢Ọ/’,“642-*+)9(8/17035”ḥⱮ

A monadic Link accepting a list of characters which yields a list of characters.
Try it online!
How?
ỴZ⁶=ẠƊ€œp$“¢Ọ/’,“642-*+)9(8/17035”ḥⱮ - Link: list of characters, I
Ỵ                                    - split at newline characters
 Z                                   - transpose
         $                           - last two links as a monad - i.e. f(X):
     Ɗ€                              -   for each, last three links as a monad:
  ⁶                                  -     the space character
   =                                 -     equals? (vectorises)
    Ạ                                -     all?
       œp                            -   split (X) at truthy indices of (that)
                                     -     (...call the result A)
          “¢Ọ/’                      - base 250 int = 170548 (salt)
                “642-*+)9(8/17035”   - list of characters "642-*+)9(8/17035" (domain)
               ,                     - pair -> [salt, domain]
                                   Ɱ - map across A with:
                                  ḥ  -   Jelly's hash function with salt and domain

05AB1E, 54 40 39 bytes
"2(-1 0/ 9 6*)+"Ž´Š«|€SøJð4×¡JÇ2δβŽ4w%è

Can definitely be golfed some more with smarter magical integers (including changing the ā‡ to for example Åβ or changing the order of the charcters in the strings), but I'm pretty bad at those kind of challenges personally, so this will do for now.
-14 bytes thanks to @ovs, because he is skilled in these kind of magic integer challenges. ^_^
Try it online or verify all test cases.
Explanation:
"2(-1 0/ 9 6*)+"      # Push this string
                Ž´Š   # Push compressed integer 45783
                   «  # Append it to the string: "2(-1 0/ 9 6*)+45783"
|                     # Push all input-lines as list
 €S                   # Convert each line to a list of characters
   ø                  # Zip/transpose; swapping rows/columns
    J                 # Join each inner list (column) together to a string
     ð4×              # Push a string of 4 space characters: "    "
        ¡             # Split the list on that
         J            # Join each inner list of strings to a single string
          Ç           # Convert each string to a list of codepoint integers
            δ         # For each list of integers:
           2 β        #  Convert from a base-2 list to a base-10 integer
              Ž4w%    # Modulo-1078 on each value
è                     # And then (modulair 0-based) index them into the string
                      # (after which the result is output implicitly)

See this 05AB1E tips of mine (section How to compress large integers?) to understand why Ž´Š is 45783 and Ž4w is 1078.

40 bytes by using code points and base conversion to convert strings to integers. I haven't tried other bases than 2, so there is probably still something shorter.

@ovs Thanks! That's indeed a lot better. And in your approach I can remove the map for another -1, since most of the builtins vectorize.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Read an ASCII clock
Related to, but not a duplicate of, this challenge.
Basics
This is a clock:
              ******
          **     |    **
      **         |        **
    *            |           *
    *            |           *
  *              |             *
  *              |             *
*                |               *
*                |               *
*                |_______        *
*                                *
*                                *
*                                *
  *                            *
  *                            *
    *                        *
    *                        *
      **                  **
          **          **
              ******

Let's note some of the basic properties:

It's a circle, 40*20 (width*height) characters, made up of asterisks.
There are two hands: a minute hand made of 9 pipe characters (|); and an hour hand made of 7 underscores (_). I.e., in this example the time is 3:00

If a clock weren't arranged in right angles, it might look something like this:
              ******
          **          **
      **  |               **
    *      |                 *
    *       |                *
  *          |                 *
  *           |                *
*              |                 *
*               |                *
*                |_              *
*                   _            *
*                     _          *
*                       _        *
  *                            *
  *                            *
    *                        *
    *                        *
      **                  **
          **          **
              ******

This represents 4:55.
What's happened here is:

We determine the destination (see the diagram below).
We determine the number of spaces to delimit by. This will either be 0, 1, or 2 (see the table below).
We draw the line by using the respective character (| for minute, _ for hour).
We then cut off the line at the number of characters (9 for minute, 7 for hour), including spaces, from the center of the circle along the x-axis. If we reach the edge of the clock, we stop anyway:

              ******
       |  **          **
      *|  |               **
    *  |   |                 *
    *  |    |                *
  *    |     |                 *
  *    |      |                *
*      |       |                 *
*      |        | 1234567|       *
*      |         |_      |       *
*      |987654321   _    |       *
*                     _  |       *
*                       _|       *
  *                            *
  *                            *
    *                        *
    *                        *
      **                  **
          **          **
              ******

For the sake of completeness, here's a diagram of all possible angles. This applies to minute-hands too: they won't go more specific than 5-minute intervals.
              **→0←*
          ↓*          ** ↓
      ** →11             1←*
    *                        *
    *↓                      ↓*
  * →10                     2← *
  *                            *
*                                *
*                                ↓
↓               •                3
9                                ↑
↑                                *
*                                *
  *                            *
  * →8                      4← *
    *↑                      ↑*
    *                        *
      ** →7              5←*
          ↑*          ** ↑
              *→6←**

The number of spaces to reach each point is as follows:
+-------+----------------------------------------+
| Point | No. of spaces to delimit with to reach |
+-------+----------------------------------------+
| 1     | 1                                      |
+-------+----------------------------------------+
| 2     | 2                                      |
+-------+----------------------------------------+
| 3     | 0                                      |
+-------+----------------------------------------+
| 4     | 2                                      |
+-------+----------------------------------------+
| 5     | 1                                      |
+-------+----------------------------------------+
| 6     | 0                                      |
+-------+----------------------------------------+
| 7     | 1                                      |
+-------+----------------------------------------+
| 8     | 2                                      |
+-------+----------------------------------------+
| 9     | 0                                      |
+-------+----------------------------------------+
| 10    | 2                                      |
+-------+----------------------------------------+
| 11    | 1                                      |
+-------+----------------------------------------+
| 0     | 0                                      |
+-------+----------------------------------------+

Note that it is asymmetrical. However, if you wish, you can also take input with the clock flipped vertically, horizontally or both, e.g.
              *→○←**
         ↓**          **↓
      **→○              ○←**
    *                        *
    *↓                      ↓*
  * →○                      ○← *
  *                            *
*                                *
*                                ↓
↓                •               ○
○                                ↑
↑                                *
*                                *
  *                            *
  * →○                      ○← *
    *↑                      ↑*
    *                        *
      **→○              ○←**
         ↑**          **↑
              **→○←*

(flipped horizontally)
Similarly, when two hands overlap (see below) both hands would usually be aligned to the top of the top-left of the four centre squares. When requesting a flipped input, the centre location will also be flipped accordingly. Note that you cannot mix the two: if you want a flipped input, all aspects, including the centre-point and the angle anchors, will be flipped. (On these example diagrams, the centre-point is represented with the centre dot •)
For this challenge:

The minute hand will always be a multiple of five
The hour hand will always be on the base of the hour (e.g. even if it is 5:59, the hour hand will be exactly on 5)
Only valid times will be given, and the size of the clock will be constant
If the hour hand and minute hand are on the same line, the hour hand (_) will be used for the first seven characters, followed by | for two more, e.g.:

              ******
          **          **
      **                  **
    *                        *
    *                        *
  *                            *
  *                            *
*                                *
*                                *
*               _                *
*             _                  *
*           _                    *
*         _                      *
  *     |                      *
  *                            *
    *                        *
    *                        *
      **                  **
          **          **
              ******

would represent 8:40.
Challenge
Given a clock in this format, output the time displayed on the clock. The time should be in 12-hour format (i.e. not starting at 12), but the top number can be 0 or 12, as you wish.
Rules

You can return the time as an array of [hours, minutes], a string delimited by some character, or any other reasonable format. You must return pure, base-10 numbers, though: hex representations (0-A instead of 0-11) or other replacements for numbers are disallowed.
Results can be padded by whitespace or zeros if you wish (e.g. 01:12 instead of 1:12)
The characters mentioned here must be the ones used by your program. Your submission cannot require substitution of these characters for something else, e.g. take a clock with '#' for the hour hand. Further, the input will always contain the spaces at the start of lines, but spaces after the clock (on the right of the diagram) are optional, e.g.:

              ******
          **     |    **
      **         |        **
    *            |           *
    *            |           *
  *              |             *
  *              |             *
*                |               *
*                |               *
*                |_______        *
*                                *
*                                *
*                                *
  *                            *
  *                            *
    *                        *
    *                        *
      **                  **
          **          **
              ******

(select this!)

Input can be taken as an array of lines or a single newline-delimited string. Standard I/O rules apply.
Standard loopholes are disallowed.
This is code-golf, so shortest answer in bytes wins.

@JonathanAllan The minute hand is 9 characters long if you include the spaces (see the diagram on step 4). Note that there's two spaces here instead of one, which may be the cause of the confusion. I was trying to figure out your second point for a while, because I couldn't figure out the source of the issue; turns out, I just needed a clarification in the rules about the alignment.

I'm still unsure about the rules dictating where the central-most characters are displayed - the central-most hour character is not on top of the central-most minute character in the 3:00 or the 4:55 examples, yet it is in the 8:40 one. ("hands would usually be aligned to the top of the top-left of the four centre squares." - is that true for 3:00 and 4:55?)

@JonathanAllan See now.

I'm confused by the center dot • in combination with the 8:40 example and positions of the 6 and 9 o'clock os in your graph.. Being an asymmetrical circle, it seems there are three different centers to start from - where the hours 6, 8, and 9 differ from that dot •, unless I'm doing something wrong? Here a pastebin of how I currently understand the hour and minute arms of each time. I'm pretty sure it's incorrect, but I'm not sure what the intended arms should be instead..

I cannot work out the rules of the central-most characters still. Maybe a link to code that produces a clock given the time would help here?

05AB1E (legacy), 51 50 bytes
•4D-aÕΩ/È°øcû'a•žAвè'_kI•5₁¦M5₅Ï¶ÊäÄVd‰•558вè'|k5*‚

Input as a single multi-line string without trailing spaces; output as a pair of [hours, minutes].
-1 byte by switching to the legacy version, where the max/min works on character-lists, based on the ordinal codepoint values of the characters. (In the new version it will simply return the first character instead..)
Try it online or verify all test cases.
Assumes these below are all the clock arms:
              ******
          **     |    **
      **  |      |      | **
    *      |     0     1     *
    *       B    0    1      *
  *     |    B   0   1   |     *
  *       A   B  0  1  2       *
*           A  B 0 1 2           *
*             A B012             *
*               yx333333||       *
*      ||99999##z 5 4            *
*           8 7 6  5  4          *
*         8  7  6   5   4        *
  *     |   7   6    5    |    *
  *        7    6     5        *
    *     7     6      5     *
    *    |      6       |    *
      **        |         **
          **    |     **
              ******

Where:

0-B represents the hour-arms for the hours 0 to 11;
| represents the tips of the minute-arms;
xyz represents the -multiple- cents, where x is the center for 0,1,2,3,4,5,11; y is the center for 7,8,10; and z is the center for 6,9;
# are overlapping hour-numbers (for 7&9 and 8&9 respectively).

If they are incorrect (which is likely, since I have multiple centers, and the challenge description is a bit confusing tbh..), the code can easily be modified to correct the arms. The approach will remain the same, I'd just have to adjust the indices in the compressed lists in that case.
Explanation:
Checks at the following positions in the input-string:
              ******
          **          **
      **  l      a      b **
    *                        *
    *       L    A    B      *
  *     k                c     *
  *       K            C       *
*                                *
*                                *
*                      D d       *
*      j J                       *
*                                *
*         I             E        *
  *     i                 e    *
  *                            *
    *     H     G      F     *
    *    h              f    *
      **        g         **
          **          **
              ******

It will first get a list of all characters in the uppercase positions of the graph above (in alphabetical/clock order), and will use the first 0-based index in this list where it finds a '_' as the hour. It will do the same with the lowercase positions and '|', after which it will multiply this by 5 as the minutes.
•4D-aÕΩ/È°øcû'a•  '# Push compressed integer 78119436285968343280298302466166
  žAв              # Converted to base-512 as list: [123,128,193,296,402,502,495,489,388,317,180,118]
     è             # Get the characters at those indices in the (implicit) input-string
      '_k         '# Get the first index of an '_'
•5₁¦M5₅Ï¶ÊäÄVd‰•   # Push compressed integer 103082336338078574425677583851482
  558в             # Converted to base-558 as list: [63,70,162,298,439,534,557,519,421,315,145,56]
I     è            # Get the characters at those indices in the input-string
       Z           # Get the maximum character in this list (without popping the list),
                   # which will always be the '|'
        k          # Get the index of this '|' in the list
         5*        # Multiply that by 5
‚                  # And pair both integers together
                   # (after which it is output implicitly as result)

See this 05AB1E tip of mine (sections How to compress large integers? and How to compress integer lists?) to understand why •4D-aÕΩ/È°øcû'a• is 78119436285968343280298302466166; •4D-aÕΩ/È°øcû'a•žAв is [123,128,193,296,402,502,495,489,388,317,180,118]; •5₁¦M5₅Ï¶ÊäÄVd‰• is 103082336338078574425677583851482; and •5₁¦M5₅Ï¶ÊäÄVd‰•558в is [63,70,162,298,439,534,557,519,421,315,145,56].


text:
Classify State's Senators
United States senators are sorted into three classes, based on what year their six-year term starts. Since each state has two senators, each state has a senator in two of the three classes.
Given a full state name and a class number (1, 2, or 3), output truthy if that state has a senator of that class, and falsey if that state does not have a senator of that class.
States with Class 1 senators:

Arizona, California, Connecticut, Delaware, Florida, Hawaii, Indiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Jersey, New Mexico, New York, North Dakota, Ohio, Pennsylvania, Rhode Island, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin, Wyoming

States with Class 2 senators:

Alabama, Alaska, Arkansas, Colorado, Delaware, Georgia, Idaho, Illinois, Iowa, Kansas, Kentucky, Louisiana, Maine, Massachusetts, Michigan, Minnesota, Mississippi, Montana, Nebraska, New Hampshire, New Jersey, New Mexico, North Carolina, Oklahoma, Oregon, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Virginia, West Virginia, Wyoming

States with Class 3 senators:

Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maryland, Missouri, Nevada, New Hampshire, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, South Carolina, South Dakota, Utah, Vermont, Washington, Wisconsin

Test Cases
"Rhode Island", 1 -> true
"Rhode Island", 2 -> true
"Rhode Island", 3 -> false
"California", 1 -> true
"California", 2 -> false
"California", 3 -> true
"South Dakota", 1 -> false
"South Dakota", 2 -> true
"South Dakota", 3 -> true

Python 2, 67 63 bytes
lambda s,l:0x764d5443a33628366/3**(hash(s)%4560%1502%43)%3+1!=l

Try it online!
The states can be sorted into three disjoint categories, based on what class of senators they don't have. hash(s)%4560%1502%43 generates a number \$0 \le k \le 42 \$ without mixing up the categories. This number is then used to get a single base-3 digit out of 0x764d5443a33628366.

JavaScript (ES6),  98 ... 83  79 bytes
A regex solution.
Returns a non-zero value if the state has a senator of the given class.
s=>n=>n^=/Oh|gt|N.*D|t$|yl|[UYfv]|[Wdir]i/.test(s)?2:/^I|[ACGHKLOS]/.test(s)||3

Try it online!
How?
The first regular expression matches the states with class 1 and class 3 senators:
 pattern    | states
------------+---------------------------------------------------------------------------
 Oh         | Ohio
 gt         | Washington
 N.*D       | North Dakota
 t$         | Connecticut, Vermont
 yl         | Maryland, Pennsylvania
 [UYfv]     | California, Nevada, New York, (Pennsylvania), Utah
 [Wdir]i    | Arizona, Florida, Hawaii, Indiana, Missouri, Wisconsin
The second regular expression matches the states with class 2 and class 3 senators:
 pattern    | states
------------+---------------------------------------------------------------------------
 ^I         | Idaho, Illinois, (Indiana1), Iowa
 [ACGHKLOS] | Alabama, Alaska, (Arizona1), Arkansas, (California1), Colorado,
            | (Connecticut1), Georgia, (Hawaii1), Kansas, Kentucky, Louisiana,
            | New Hampshire, North Carolina, (Ohio1), Oklahoma, Oregon, South Carolina,
            | South Dakota
1: These states belong to the first group. But if they've already been identified as such by the first regular expression, this one will not be executed anyway.
The states with class 1 and class 2 senators are matched by neither of them:
Maine, Nebraska, Massachusetts, Michigan, Delaware, Minnesota, New Jersey, Tennessee,
West Virginia, Mississippi, Virginia, Wyoming, Montana, Rhode Island, New Mexico, Texas

JavaScript (Node.js), 79 bytes
Returns a non-zero value if the state has a senator of the given class.
s=>n=>0x3A27C2823007F077n.toString(3)[parseInt(s[8]+5+s,35)%462%255%113%56]^~-n

Try it online!
The method used to transform the input string is similar to the one described in my answer to this related challenge. Its purpose is to solve the 3 problems we have in JS:

no built-in hash function
parseInt() breaks on non-alphanumeric characters
only 52 bits of mantissa for Numbers (i.e. 2 distinct strings sharing the same prefix may be parsed the same way)


text:
Can I Type This With My Left Hand?
Inspiration
The longest words that can be typed with only the left hand on a standard QWERTY keyboard are "sweaterdresses", "tesseradecades", and "aftercataracts" (Source: Wikipedia).
Challenge
Given as input a "keyboard" \$K\$ and a string \$S\$ determine whether \$S\$ can be typed using only the left hand on keyboard \$K\$.
Input
The keyboard \$K\$ will be provided as a list of 3 rows. You may take this input in any reasonable format (eg. a list of 3 strings, a list of 3 lists of characters, etc.), but please do not take the left-hand-side and right-hand-side of the keyboard separately, as that defeats the purpose of the challenge.
You may assume that the input contains only lowercase letters (or only uppercase letters if you wish). Each of the three rows of the keyboard may be of any non-zero size, but each letter from a-z will appear only once on the keyboard.
Example 1: [qwertyuiop, asdfghjkl, zxcvbnm]
Example 2: [qazwsxplkm, edcrfv, tgbyhnuji]
The string \$S\$ may also be taken as input in any reasonable format.
Output
Output a truthy value if the string \$S\$ can be typed using the left hand on the keyboard \$K\$ and a falsey value otherwise.
For the purposes of this challenge: A word can be typed with the left hand if it is made up solely of letters appearing in the first half of each row of the keyboard. If a row contains an odd number of letters, the middle letter is also included in the first half.
Using the row asdfghjkl as an example, the word gafs can be typed with the left hand.
Scoring
This is code-golf. Make your code as short as possible.
Test Cases
These are formatted as \$K\$, \$S\$ -> (expected output)
[qwertyuiop, asdfghjkl, zxcvbnm], qazg -> true
[qwertyuiop, asdfghjkl, zxcvbnm], qpazg -> false
[p, asdfghjklqwertyuio, zxcvbnm], sxzklkl -> true
[p, asdfghjklqwertyuio, zxcvbnm], b -> false
[qazwsxplkm, edocrfv, tgbyhnuji], bad -> true
[qazwsxplkm, edocrfv, tgbyhnuji], tex -> false
[thequick, brownfx, jmpsvlazydg], brow -> true
[thequick, brownfx, jmpsvlazydg], fox -> false

qazwsxplkm, edcrfv, tgbyhnuji doesn't contains letter o? So will there be a testcase, like, [qazwsxplkm, edcrfv, tgbyhnuji], zoo?

@tsh Sorry, that was a typo. All the letters of the alphabet should be on the keyboard

Just a silly note, but on french keyboards there are letters on the "digits" row (upper row), for example "é" can be accessed with left hand while "è" isn't. We could imagine it to be added to one of the other rows, but that would defeat answers that base on the length of the row to extract the "left" subset..

I just typed this entire comment with my left hand. :)

"solely of letters appearing in the first half of each row".  So, unlike in real life (first 5 characters), the Example1, "zxcvbnm", means that the letter "b" is not a left-hand letter.

Relevant XKCD

@Kaddath Keyboard with more rows: https://en.wikipedia.org/wiki/File:200801191443_Japanische_Tastatur.jpeg

"Pretty please don't do this or else the challenge is pointless"...?

That's not quite right as many people do all their typing with just one finger.

Python 3, 48 bytes
Takes as input \$ K \$ and \$ S \$, the keyboard and the target string. \$ K \$ is a taken as a list of lists.
lambda K,S:{r.pop(0)for r in K for i in r}>={*S}

Try it online!
Explanation
It essentially converts \$ S \$ and the valid keyboard characters \$ K' \$ into sets, and returns True iff \$ S \$ is a subset of \$ K' \$. To obtain only the first half of each row of \$ K \$, we use the pop trick, which is explained in this answer of mine.

The previous answer, where \$ K \$ is taken as a list of strings instead.
Python 3, 54 bytes
lambda K,S:{*''.join(r[:-~len(r)//2]for r in K)}>={*S}

Try it online!

J, 22 21 bytes
a:=(-.>.@-:@#$])~&.>/

Try it online!
-1 byte thanks to FrownyFrog

Takes input as boxed words, with the string to test at the end.
Reduces the list, set-subtracting -. the first half -.>.@-:@# of each row $]  from the string to test.
Check if the result is empty: a:=

Here also {. can be $

05AB1E, 8 bytes
-2 thanks to Kevin Cruijssen.
ε2ä¬}JÃQ

Try it online!
Explanation
ε          For each item of the input list:
 2ä        Split into chunks of size 2
           (conveniently, the middle character is included in the left half)
   ¬}      Take the head of this list
     J     Join the output string
      Ã    List intersection with the input
       Q   is the input

-2 by using ÃQ instead of s€åß

Bash + Unix utilities, 57 bytes
s()(echo ${1:0:(${#1}+1)/2});grep ^[`s $1``s $2``s $3`]*$

Try it online!
The three keyboard rows are passed as arguments, and the input string is passed on stdin.
Output is the exit code (0 for truthy, 1 for falsey).
This can probably be improved with clever golfing.

Retina 0.8.2, 42 34 bytes
r`(?<-1>.)+(?<=(\w\w)+),
,
D`\w
,$

Try it online! Link includes test cases. Explanation:
r`(?<-1>.)+(?<=(\w\w)+),
,

The r modifier causes the regex to be processed from right to left, so that the , is matched first, before the lookbehind then matches as many pairs of letters as possible. .NET captures each matching pair into a stack of values for capture group 1. The balancing group then matches once for each value in the stack, thus deleting 1 character from the end of the row for every pair of letters.
D`\w

Remove all duplicate letters.
,$

Check that no letters of S remain.

Jelly, 9 bytes
ŒH€ZḢFfƑ@

A dyadic Link accepting a list of lists of characters on the left and a list of characters on the right which yields 1 if the right may be typed with the left hand or 0 if not.
Try it online!
How?
ŒH€ZḢFfƑ@ - Link: keys, word
ŒH€       - halve each
   Z      - transpose
    Ḣ     - head
     F    - flatten
        @ - with swapped arguments:
       Ƒ  -   is invariant under?:
      f   -     filter keep

C (GCC) 114 109 108 105 102 bytes
-3 bytes ceilingcat
i,h,t,r;f(char**k,char*s){for(r=1;*s;++s)for(i=3;i--;)for(h=strlen(k[i]);t=k[i][++h/2];)r*=t!=*s;i=r;}

Try it online!

Google Sheets, 106 99 Bytes
=ArrayFormula(1-IsErr(Or(Find(Mid(B1,Row(Offset(A1,0,0,Len(B1))),1),Join(,Left(A:A,Round(Len(A:A)/2

Keyboard input is in the range A1:A3. The word is input in B1. After entering the formula, Sheets will automatically add 7 trailing parentheses.

Join(,Left(A:A,Round(Len(A:A)/2))) combines the left-hand side of the keyboard rows into a single string we can search later.
Mid(B1,Row(Offset(A1,0,0,Len(B1))),1) pulls each letter of the word, one character at a time.
Or(Find(Mid(~),Join(~))) searches for each character in the search string and returns the location of each (a positive integer). If it can't find the character, it returns the #VALUE! error. Therefore, Or(~) returns either TRUE or #VALUE!.
1-IsErr(Or(~)) returns 1 for TRUE and 0 for #VALUE!.
ArrayFormula(~) makes all these pieces work on input and output arrays instead of individual cells. This only matters for joining the input keyboard into a string and pulling out one character at a time from the word.

JavaScript (Node.js), 51 bytes
k=>s=>s.every(c=>k.some(l=>l.length/l.search(c)>2))

Try it online!
Input keyboard as an array of three strings. Input the word as an array of characters.

x86 32-bit machine code: 34 31 bytes
Strategy: build a bitmap of left-hand keys with bit test-and-set (bts), then loop over the input string and check against that bitmap (bt).  386 bt* instructions with a register destination mask the bit-index like shifts do, so we can use ASCII characters directly as bit indices.  (0x61 .. 0x7a)
Inputs:

EDI: const char *str (0-terminated C string)
ESI: points at rows serialized into 3 back-to-back explicit-length strings in a buffer.  3x { dword length, char[] }, no indirection just flat byte stream concatenated to be loaded with lodsd / lodsb.  Asm wrapper to do this conversion from an array of 3x char* included with the test harness on TIO.

Output: AL=first non-left-hand character (non-zero=falsy), or zero=truthy (the terminator).  Assembly language can just as easily jump on non-zero as on zero so this is justified.  An alternate version of this took an explicit-length string and returned 0 or 1 in the CF flag.
Clobbers: all GP registers except ESP

 1                                  tlh:
 2 00000000 31DB                        xor   ebx, ebx              ; left hand keys bitmap
 3 00000002 8D4B03                      lea   ecx, [ebx + 3]
 4                                  .rows:
 5 00000005 AD                          lodsd              ; length.  Upper bytes zero because each letter can appear at most once.
 6 00000006 8D2C06                      lea   ebp, [esi + eax]
 7 00000009 92                          xchg  edx, eax
 8                                    .keys:                   ; do{
 9 0000000A AC                              lodsb
10 0000000B 0FABC3                          bts   ebx, eax      ; bmap |= 1<<(c & 31)
11 0000000E 4A                              dec   edx
12 0000000F 4A                              dec   edx
13 00000010 7FF8                            jg   .keys        ; while(len-=2 > 0);  // handles the len=0 case where --len becomes negative
14 00000012 89EE                        mov   esi, ebp      ; skip 2nd half of string
15 00000014 E2EF                        loop  .rows
16
17                                  ;;; If the input string indexes any bit in EBX that isn't set, it's not left-hand typeable
18 00000016 89FE                        mov   esi, edi
19                                  .chars:               ; do{
20 00000018 AC                          lodsb
21 00000019 0FA3C3                      bt    ebx, eax
22 0000001C 72FA                        jc  .chars
23                                  .exit:
24                                      ; non-zero AL means we found a non-left-hand character.
25                                      ; zero means we found the terminating 0.  ASCII 'a' = 0x61 so our bitmap always has bit 0 = 0
26 0000001E C3                          ret

TODO:

A better row input format to save instructions in the input code?  (When I designed this format, I forgot about having to skip over the right half of a row that I wasn't going to read.  lea ebp, [start + len] + mov was a bugfix.  It would be nice to at least not need that many regs.)
Maybe start with an all-1 bitmap and clear bits for right-hand keys?  But that introduces a corner case for a row of length 1 which has no right-hand keys.  Otherwise it might allow efficient looping to the end of a 0-terminated string.

I used the nice C test harness from @Noodle9's answer.  This is 32-bit asm so it would be a double pain to get something runnable on TIO.run with NASM.  (You can use FASM to make a 32-bit executable directly, without a separate linker invocation, but I think that doesn't link libc.  You could I guess inline a simple strlen, or hard-code some data structures to at least exit with a 0 / 1 exit status...)  I put the source + asm wrapper (to adapt to a normal C calling convention), and C test harness itself on TIO even though you can't actually try it there.
$ nasm -f elf32 -l/dev/stdout type-left-hand.asm &&
 gcc -Wall -fno-pie -no-pie -m32 type-left-hand.[co] &&
 ./a.out
qwertyuiop asdfghjkl zxcvbnm
qazg -> 1 (1)
qpazg -> 0 (1)
p asdfghjklqwertyuio zxcvbnm
sxzklkl -> 1 (1)
b -> 0 (1)
qazwsxplkm edocrfv tgbyhnuji
bad -> 1 (1)
tex -> 0 (1)
thequick brownfx jmpsvlazydg
brow -> 1 (1)
fox -> 0 (1)

0 / 1 (1) means left-hand typeable (matches the correct result)

C (gcc), 116 \$\cdots\$ 108 104 bytes
Saved 4 bytes thanks to rtpax!!!
Saved 4 bytes thanks to ceilingcat!!!
c;p;l;r;i;f(char**k,char*s){for(r=1;*s;++s)for(i=3;i--;r&=l>p*2)for(l=p=0;c=k[i][l];++l)p=c-*s?p:l;c=r;}

Try it online!
Takes the keyboard as an array of strings and the word as a string.
Returns \$1\$ for true and \$0\$ otherwise.

112 brings you shorter than mine

@rtpax Going the other way with i - nice one, thanks! :-)

Haskell, 69 bytes
x l=take(length l`div`2)l;l k s=all(\c->elem c$foldl(++)[]$map x k)s

Use (in ghci):
$ let kbd = ["qwertyuiop","asdfghjkl;","zxcvbnm,./"]
$ l kbd "stewardesses"
=> True
$ l kbd "joker"
=> False

foldl(++)[] is the same as concat. concat$map is the same as concatMap. Finally, concatMap x k is the same as just x=<<k.

l k s=all(...)s can be eta-reduced to l k=all(...). (\c->elem c$x=<<k) can be shortened to (`elem`(x=<<k)).

Using pointfree.io, it turns out x l=take(length ldiv2)l can be equivalently written as take=<<(`div`2).length and thus be inlined in l.

Using pointfree.io yet again, we arrive at a 44 byte version: all.flip elem.((take =<<(`div`2).length)=<<). Try it online!

C# (Visual C# Interactive Compiler), 56 63 bytes
k=>s=>s.All(c=>k.Any(l=>(uint)l.IndexOf(c)/(float)l.Length<.5))

Try it online!

I think you need to include the usings in your byte count. In this case, I think you can inline them though

Admittedly, I don't really golf in C#, so there might be a shorter way than what I'm suggesting. I'd recommend checking out Tips for golfing in C# if you haven't already

Thanks for the tips! But if I can't use the usings I think I'll just write their keywords instead of the full types

R, 72 71 bytes
function(k,s)all(t(sapply(k,function(x)match(s,x,0)))<(lengths(k)+2)/2)

Try it online!

JavaScript (ES6), 53 bytes
Takes input as (keyboard)(word). Returns a Boolean value.
k=>w=>!w.match(`[${k.map(r=>r.slice(-r.length/2))}]`)

Try it online!

Charcoal, 12 bytes
⬤η⊙θ№…λ⊘⊕Ｌλι

Try it online! Link is to verbose version of code. Takes input as a list and a string. Output is a Charcoal boolean, i.e. - for true, nothing for false. Explanation:
 η              Input S
⬤               All characters
   θ            Input `K`
  ⊙             Any row
      λ         Current row
     …          Truncated to
       ⊘⊕Ｌλ     Half its length rounded up
    №      ι    Contains input character
                Implicitly print

Python 2, 57 55 bytes
-2 bytes thanks to @ovs !

lambda k,s:all(t.find(c)*2<len(t)for t in k for c in s)

Try it online!

2 bytes shorter with t.find(c)*2<len(t).

Python 3, 53 bytes
lambda k,w:all(max(map(r.find,w))<len(r)/2for r in k)

Try it online!


text:
Build the smallest number
Given a non-empty list of digits 0 though 9, output the smallest number that can be produced by an expression formed by reordering these digits and introducing exponentiation signs ^, with adjacent digits getting concatenated as multi-digit numbers. Exponentiation is evaluated as right-associative.
For example, [4, 2, 3, 3] could become 2^34^3 which evaluates as 2^(34^3), but simply writing 2334 is smallest here. You can assume that any array containing a 0 gives a minimum of zero (a special case), or that it's achievable by an expression like 0^rest, or like 00 for just zeroes.
The input list can be taken as any ordered sequence, but not as an unordered (multi)set.
Test cases:
[2,3] => 8 (2^3)
[3,3] => 27 (3^3)
[4,3] => 34 (34)
[1,2,3] => 1 (1^2^3)
[2,2,2] => 16 (2^2^2)
[2,3,2] => 81 (2^3^2)
[3,0] => 0 (Special, or maybe 0^3)
[0,1,0] => 0 (Special, or maybe 0^10)

Shortest code in each language wins. I'll accept an answer just to give the +15 rep without any specific accepting standard.

"Acception only act as a +15."
Are you saying that when/if you accept an answer, it will only count as 15 reputation?

I like the challenge concept, but your text is hard to read and it took me a few tries to understand it.

@ouflak That means if someone is accept, it only mean he get 15 reputation, I don't claim any accepting standard

For golfers who might want to write a non-brute-force solution, it looks like the minimal result is the digits concatenated in sorted order, except for smaller values of 0 for any list with a 0, 1 for any list with a 1, and these six values produced from power expressions: 2^2=4, 2^3=8, 2^4=16, 3^3=27, 2^2^2=16, 3^2^2=81.

Probably worth including [2,3,2] in the examples.

@xnor I said Output 0 if 0 is in the input array. because case [0,0] is out of the rule, 0^0 and 00 are both bad

@l4m2 Ah, I was thinking that would just be 00. I'll clarify.

05AB1E, 12 11 bytes
œε.œJ€.«m}ß

Try it online or verify all test cases or try it online with added debug-lines.
Explanation:
œ            # Get all permutations of the (implicit) input-list
 ε           # Map each permutation to:
  .œ         #  Get all its partitions
    J        #  Join each inner-most list together
     €       #  For each inner list:
      .«     #   Right-reduce it by:
        m    #    Taking the power
         }ß  # After the map: pop and push the flattened minimum
             # (after which it is output implicitly as result)

Japt -g, 12 bytes
á Ër!p mDìÃn

Try it

Fails for [2,2,3], which results in 64 instead of 81.

You don't write $2{^2} {^3}$, but $3^{2^2}$ is fine

@KevinCruijssen, 2**3**2=64

"and power must go from right to left" -> 2**(3**2) = 512

@JonathanAllan, right to left, which doesn't make sense, still gives the same result as the equation is a palindrome. Parentheses aren't mentioned in the spec but that would make the equation read middle to right first.

It means that the precedence is to be treated as right-most first, i.e. 2**3**2 is to be $2^{(3^2)}=2^9=512$.

@JonathanAllan, still doesn't make any sense to me as to why (remember: that mathematical notation stuff doesn't work on phones) but this should now give the results people seem to be expecting.

Jelly, 10 bytes
Œ!*@/€;ḌƊṂ

A monadic link accepting a list of digits yields an integer.
Try it online!
How?
Checks digital and power-wise evaluations of all permutations even though we only need to check forward-sorted-digital, forward-sorted-power-wise, and reverse-sorted-power-wise (and only for [3,2,2]), because it's far terser.
Note that there is no need to check any mixture of digital and power-wise evaluations (they can never be strictly smaller than one of the three previously mentioned evaluations)
Œ!*@/€;ḌƊṂ - Link: list, L
Œ!         - all permutations (of L) -> P
        Ɗ  - last three links as a monad:
     €     -   for each (p in P):
    /      -     reduce with:
   @       -       using swapped arguments:
  *        -         exponentiation
       Ḍ   -   un-decimal (vectorises across P)
      ;    -   concatenate (these two lists of numbers)
         Ṃ - minimum

Notice that you happen to use 0^1^0^0 on [0,0,0,1] and 0000 on [0,0,0,0]. Unexpected work :)

Io, 77 bytes
Based on xnor's observation in the comment section. -12 bytes thanks to Arnauld's idea.
method(x,y :=x sort;if(y==list(2,2,3),81,y join()asNumber min(y reduce(**))))

Try it online!
Explanation
method(x,           // Anonymous method with param x
    y := x sort     // Assign y to sorted x
    if(y == list(2,2,3), // Edge case treatment
        81,              // (It's a kinda weird case that goes right to left)
        ,y join()asNumber// Join the sorted digit-list into a single number.
        min(                // Minimum with:
            y reduce(**)))) // the sorted list reduced by the power function.

JavaScript (ES7),  65  62 bytes
Fixed thanks to @xnor and @l4m2
Saved 3 bytes thanks to @l4m2
a=>Math.min(x=a.sort().join``,a[0]&&eval(x-223?a.join`**`:81))

Try it online!
How?
The general case is to look for the minimum of the concatenation of the digits in ascending order and an exponent chain, also in ascending order.
But as noticed by @xnor, there are a few special cases:

if the list contains a \$0\$, the result is always \$0\$
for [3,2,2], the minimum value is \$3^{2^2}=81\$

Be careful with the [3,2,2] input

@xnor Thank you for the notification. Hopefully fixed now.

Fail on [0,0,1]

@l4m2 Thanks. Updated.

Fail on [3,2,2,0,0]. I consider x*a[0] in numbers for min instead

https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@z/R1s43sSRDLzczTyO1LDFHI1GvOL@oRENTLys/My9BSytBU6fCNhHCS9Cp0DUyMravsLIw1KnQSow2iNX8n5yfV5yfk6qXk5@ukaYRbaRjpGOsA5TQVODCLkVAkqA0VMF/AA

@l4m2 Good idea!

a=>Math.min(x=a.sort().join'',a[0]&&eval(a.join'**'),x-223?x:81) thought a[0] is a char and find it isn't

https://tio.run/##hY9bCoJAFIbfW8U8yRmxcS5SElgraAWiOJiWYTOhEu3eFCXUJjzn8f/4L3f5knVaFc9mq/Qla/OglcHxLJsbeRQK3oEkta4awOSuC5UkjgxpZFnZS5bw3nIuTnJQbDs5@AzjNtWq1mVGSn2FHELuiAhjNJzrIuQj4LHAmwUnFhzfIxAGzltwwus47wdjziS4j2UIWGwK5h3JJyTb9QW7N1Sk8ykUATVOmTv6rJ9iduzT6eD7dSSEGFuO@X@kFXFVHoH2Aw

perl -alp, 83 bytes
%_=(22,4,23,8,24,16,33,27,222,16,223,81);$_=join"",sort@F;$_=/0/||/1/?$&:$_{$_}||$_

Try it online!
Reads a list of white space separated numbers from STDIN, writes the answer to STDOUT. If the input contains a 0, output 0, else, if the input contains a 1, output a 1. Else, if it's one of 6 special cases, output the corresponding value. Otherwise, output the sorted input.


text:
Integers in cosine
Integers in cosine
From trigonometry we know that
\$\sin(a) =-\cos(a + \frac{(4*m + 1)\pi}{2})\$
where \$a\$ is an angle and \$m\in\mathbb{Z}\$ (integer).
The task
For an input of a positive integer \$n\$ calculate the value of the integer \$k\$ with \$n\$ digits that minimizes the difference between \$\sin(a)\$ and \$-\cos(a + k)\$. Or in a simpler way, generate the sequence A308879.
First few values
1 digit : 8
2 digits: 33
3 digits: 699
4 digits: 9929
5 digits: 51819
6 digits: 573204
Output
You can create a function or print the result on the standard output.
Your program needs to be able to calculate at least the 6 cases in the section above.
Scoring
This is code-golf, shortest code in bytes wins.
Reference
https://www.iquilezles.org/blog/?p=4760

This is A308879. You know, it's fairly obvious.

I tried searching for it and didn't find anything, thanks for finding me this :)

Can the C code in OEIS really compute the answer for 12 digit

Wolfram Language (Mathematica), 25 bytes
This uses a trick: Mathematica doesn't expand Sin[51819] into a proper number even when Max is called on a list of such things, and because of how Last works, it doesn't care that Sin[51819] is not a list and simply returns 51819.
Last@Max@Sin@Range[10^#]&

Try it online!

-1 replacing Last@ with #&@@.

Ruby, 37 bytes
->n{(1..10**n).max_by{|k|Math.sin k}}

Try it online!
Minimising the difference between \$\sin(a)\$ and \$-\cos(a+k)\$ amounts to minimising \$|k-(4m+1)\pi/2|\$ for some \$m\$, or equivalently maximising \$\sin(k)\$.
Iterating over (1..10**n) works at least for \$n\le6\$, as required. More generally, according to the OEIS (reference courtesy of @Λ̸̸'s 05AB1E answer):

It is not guaranteed that each term in the sequence produces a better approximation than the previous one,  although numerical evidence suggests so.

Iterating over (10**~-n...10**n) is guaranteed to work for any \$n\$, at a cost of 7 extra bytes.

This seems to work for n <= 8 for me.

@mypronounismonicareinstate Hence why I said 'at least for $n\le6$'... admittedly I was too lazy to keep checking beyond that. Thanks for improving the upper bound :)

Nice work, and +1. I think it would break for an n where the answer for n+1 is 10**n though (due to the inclusive range) - no idea if such an n exists, but I imagine it does.

@JonathanAllan Yes, you're right. One of the 7 extra bytes in the last sentence of my answer is taken up by switching to an exclusive range.

05AB1E, 7 bytes
Port of Dingus's answer. (It's A308879. From that page, it says that the sequence is also "the n-digit integer m that maximizes sin(m)"...)
°LΣÅ½}θ

Try it online!
Explanation
°       10 ** n
 L      1 range
  Σ     Sort by:
   Å½}  Sine
      θ Maximum under that mapping

Nice approach with the sort-by with last item! :) An alternative could have been this 7-byter: °LÅ½Zk>, with an implicit map for the Sine builtin; maximum without popping; and getting the index+1 of this maximum in the list. Too bad 05AB1E doesn't use 1-based indexing in this case. ;p

Including 10**n could be problematic (as well as inluding numbers less than 10**(n-1) - as noted on the OEIS page).

R 30 27 bytes
Following the same thread as @Dingus' Ruby answer, as indicated in the entry to A308879, i.e. looking at the maximum value of \$\sin(k)\$ over \$1,\ldots,10^n\$:
which.max(sin(1:10^scan()))

Try it online!

an alternative (which comes out to the same length, I think) is to use which.max.

@JDL: thanks. This was my first guess (see TIO) but it adds one byte. I am wondering why which.max(sin(1:10^scan())) alone does not work...

it does work for me (though with scan you need to enter an empty line after the n)

Yes thank you, I just realised I had left the f= header in my tio code! I thus corrected my answer.

Java 8, 91 bytes
n->{double r=0,m=0,s,k=Math.pow(10,n);for(;k-->1;)if((s=Math.sin(k))>m){m=s;r=k;}return r;}

Port of @Dingus' Ruby answer, so make sure to upvote him!
Try it online. (It's barely able to reach up to \$n=9\$ on TIO before it times out.)
Explanation:
n->{                           // Method with integer parameter and double return-type
  double r=0,                  //  Result-double, starting at 0
         m=0,                  //  Maximum `m`, starting at 0
         s,                    //  Integer `s` for the Sine calculation, uninitialized
  k=Math.pow(10,n);for(;k-->1; //  Loop `k` in the range (10^input, 1]:
    if((s=Math.sin(k))         //   Set `s` to the Sine of `k`
       >m){                    //   If this `s` is larger than the current maximum `m`:
      m=s;                     //    Replace the maximum with this `s`
      r=k;}                    //    And replace the result with `k`
  return r;}                   //  Return the result after the loop

@JonathanAllan I am? (Although I must admit it's coincidentally to be completely honest.) It currently loops in the range (10^n, 1] (exclusive on the left; inclusive on the right) or as notation that's inclusive on both side: [10^n-1, 1]. Dunno if the same applies to the other answers though, since I'm not too familiar with those other languages. To clarify: it starts k at $10^n$, but in the loop-check it uses k-->1 (check if $k>1$, and decrease it by 1 right after that with k--. So in the body of the very first iteration, k will be $10^n-1$.

Oh, so you are, my bad!

JavaScript (Node.js), 64 63 bytes
n=>[...Array(t=10**n)].map(_=>[9-Math.sin(--t),t]).sort()[0][1]

Try it online!

Japt -h, 10 bytes
ApU õ ñ!sM

Try it

APL (Dyalog Extended), 9 bytes
⊃⍒1○⍳10*⎕

-7 bytes from ngn and Adám.
Try it online!
APL (Dyalog Extended), 20 16 bytes
{i[⊃⍒1○i←⍳10*⍵]}

-4 bytes from Bubbler.
Try it online!
Implements Dingus's algorithm.
Explanation
{i[⊃⍒1○i←⍳10*⍵]}
{              } function body
 i     i←⍳10*⍵   assign to i the range of 1 to 10^n
     1○          find the sine of each value in i
     ⊃⍒          Grade(sort) by descending value, select index of first(maximum) value
 i[           ]  return k in i where sin k is maximum

Fortran (GFortran), 53 51 bytes
read*,n
print*,maxloc([(sin(1d0*k),k=1,10**n)])
end

Try it online!
Port of my own Ruby answer. Because why not?

Python 3, 51 bytes
import math
lambda n:max(range(10**n),key=math.sin)

Try it online!
Uses Dingus's observation about maximizing sine.

authors: Xi'an ні війні